From e5b495e0e152937701772abbd28f8ff37bc233a9 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 29 Mar 2024 10:51:35 +0800 Subject: [PATCH] Fix issue with the notifications toggle not holding the users preference --- .../App/Views/Profile/PushNotificationSettingsView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift index aaf50a9cd..9e3bd7678 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift @@ -25,7 +25,8 @@ func checkPushNotificationsStatus() { UNUserNotificationCenter.current().getNotificationSettings { settings in DispatchQueue.main.async { - self.desiredNotificationsEnabled = settings.alertSetting == UNNotificationSetting.enabled + let desired = UserDefaults.standard.bool(forKey: UserDefaultKey.notificationsEnabled.rawValue) + self.desiredNotificationsEnabled = desired && settings.alertSetting == UNNotificationSetting.enabled } } }