From b79b5aedfba6529b4d17c3e6e5c91cd9978e3b93 Mon Sep 17 00:00:00 2001 From: Maary <24504742+Steve-Mr@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:32:02 +0800 Subject: [PATCH] [fix] fix notification settings switch state --- .../java/top/maary/oblivionis/ui/screen/SettingsScreen.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/top/maary/oblivionis/ui/screen/SettingsScreen.kt b/app/src/main/java/top/maary/oblivionis/ui/screen/SettingsScreen.kt index 095f8ee..a7a14ac 100644 --- a/app/src/main/java/top/maary/oblivionis/ui/screen/SettingsScreen.kt +++ b/app/src/main/java/top/maary/oblivionis/ui/screen/SettingsScreen.kt @@ -151,7 +151,10 @@ fun SettingsScreen( } else { - notificationViewModel.cancelNotification() + scope.launch { + dataStore.setNotificationEnabled(false) + notificationViewModel.cancelNotification() + } } } }