From 4beff26e77802db28bae673d396eb6d36c98493a Mon Sep 17 00:00:00 2001 From: starry-shivam Date: Thu, 9 May 2024 11:33:51 +0530 Subject: [PATCH] fix: Fix reminder rescheduling when restoring archived goal Signed-off-by: starry-shivam --- .../starry/greenstash/ui/screens/archive/ArchiveViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/archive/ArchiveViewModel.kt b/app/src/main/java/com/starry/greenstash/ui/screens/archive/ArchiveViewModel.kt index bff2164..b04ee67 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/archive/ArchiveViewModel.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/archive/ArchiveViewModel.kt @@ -60,8 +60,8 @@ class ArchiveViewModel @Inject constructor( val updatedGoal = goal.copy(archived = false) updatedGoal.goalId = goal.goalId goalDao.updateGoal(updatedGoal) - // Schedule the reminder if it was set for the goal - if (reminderManager.isReminderSet(goal.goalId)) { + // Schedule the reminder if it was enabled for the goal. + if (goal.reminder) { reminderManager.scheduleReminder(goal.goalId) } }