From 1b795f1e6ea1c857326bba1fe690b8a8460865a5 Mon Sep 17 00:00:00 2001 From: yon Date: Sun, 17 Nov 2024 14:29:20 +0100 Subject: [PATCH] Refactor: Remove alarm cancellation from TopAppBar Removed the alarm cancellation logic from the TopAppBar's delete action. Previously, it was calling ` notificationModel.scheduleNotification` with `onReset = true` to cancel the alarm. This logic is now removed and replaced with a to-do comment indicating the need to implement the cancellation functionality elsewhere. This change likely moves the responsibility of alarm management to a more appropriate location within the application. --- .../zouitel/screens/main_screen/utils/TopAppBars.kt | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ui/screens/src/main/java/city/zouitel/screens/main_screen/utils/TopAppBars.kt b/ui/screens/src/main/java/city/zouitel/screens/main_screen/utils/TopAppBars.kt index 95cd1902..59671dc0 100644 --- a/ui/screens/src/main/java/city/zouitel/screens/main_screen/utils/TopAppBars.kt +++ b/ui/screens/src/main/java/city/zouitel/screens/main_screen/utils/TopAppBars.kt @@ -25,7 +25,6 @@ import city.zouitel.logic.events.UiEvent import city.zouitel.logic.sharNote import city.zouitel.note.model.Data import city.zouitel.note.ui.DataScreenModel -import city.zouitel.notifications.viewmodel.NotificationScreenModel import city.zouitel.screens.main_screen.MainScreenModel import city.zouitel.screens.utils.sound import city.zouitel.systemDesign.CommonConstants @@ -92,7 +91,6 @@ internal fun HomeSelectionTopAppBar( datastoreModel: DataStoreScreenModel, mainModel: MainScreenModel, dataModel: DataScreenModel, - notificationModel: NotificationScreenModel, noteAndTagModel: NoteAndTagScreenModel, tagModel: TagScreenModel, taskModel: TaskScreenModel, @@ -143,15 +141,7 @@ internal fun HomeSelectionTopAppBar( ) ) - // to cancel the alarm manager reminder. - notificationModel.scheduleNotification( - context = context, - dateTime = it.reminding, - title = it.title, - message = it.description, - uid = it.uid, - onReset = true - ) + // to.do cancel the alarm manager reminder. undo.invoke(it) } mainModel.clearSelectionNotes()