From c23c9d7d035fd542b12099d6290511cf2de8dcdd Mon Sep 17 00:00:00 2001 From: Hafiz Date: Thu, 3 Aug 2023 14:46:55 -0400 Subject: [PATCH] bailey notification fix --- .../android/habitica/ui/activities/NotificationsActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/activities/NotificationsActivity.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/activities/NotificationsActivity.kt index 93338e418d..f39227ce8a 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/activities/NotificationsActivity.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/activities/NotificationsActivity.kt @@ -228,7 +228,7 @@ class NotificationsActivity : BaseActivity(), androidx.swiperefreshlayout.widget val text = if (data?.title != null) { fromHtml("" + getString(R.string.new_bailey_update) + "
" + data.title) } else { - baileyNotification = userRepository.getNewsNotification() ?: return@withContext null + baileyNotification = userRepository.getNewsNotification() ?: notification val baileyNewsData = baileyNotification.data as? NewStuffData fromHtml("" + getString(R.string.new_bailey_update) + "
" + baileyNewsData?.title) } @@ -458,11 +458,13 @@ class NotificationsActivity : BaseActivity(), androidx.swiperefreshlayout.widget val acceptButton = item?.findViewById(R.id.accept_button) as? Button acceptButton?.setOnClickListener { + removeNotificationAndRefresh(notification) viewModel.accept(notification.id) } val rejectButton = item?.findViewById(R.id.reject_button) as? Button rejectButton?.setOnClickListener { + removeNotificationAndRefresh(notification) viewModel.reject(notification.id) }