From 7c199191908c8327a32f666082c82c761b93df05 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sun, 8 Jan 2023 11:37:02 +0100 Subject: [PATCH] Fix flow --- IceCubesApp/App/IceCubesApp.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/IceCubesApp/App/IceCubesApp.swift b/IceCubesApp/App/IceCubesApp.swift index 9ba955e5..76bc6b43 100644 --- a/IceCubesApp/App/IceCubesApp.swift +++ b/IceCubesApp/App/IceCubesApp.swift @@ -155,9 +155,6 @@ struct IceCubesApp: App { private func refreshPushSubs() { PushNotifications.shared.requestPushNotifications() - Task { - await PushNotifications.shared.fetchSubscriptions(accounts: appAccountsManager.pushAccounts) - } } } @@ -171,6 +168,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { PushNotifications.shared.pushToken = deviceToken Task { + await PushNotifications.shared.fetchSubscriptions(accounts: AppAccountsManager.shared.pushAccounts) await PushNotifications.shared.updateSubscriptions(accounts: AppAccountsManager.shared.pushAccounts) } }