From 137edccd2818748072a7d71337a8d7e4fc64f63f Mon Sep 17 00:00:00 2001 From: Evgeny Aleksandrov Date: Fri, 4 Nov 2022 21:54:18 +0300 Subject: [PATCH 1/2] Add MainActor annotation --- WooCommerce/Classes/Notifications/PushNotificationsManager.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WooCommerce/Classes/Notifications/PushNotificationsManager.swift b/WooCommerce/Classes/Notifications/PushNotificationsManager.swift index 73f6617525e..8aace869996 100644 --- a/WooCommerce/Classes/Notifications/PushNotificationsManager.swift +++ b/WooCommerce/Classes/Notifications/PushNotificationsManager.swift @@ -477,6 +477,7 @@ private extension PushNotificationsManager { /// Handles a remote notification while the app is inactive. /// /// - Parameter notification: Push notification content from a remote notification. + @MainActor func handleInactiveRemoteNotification(notification: PushNotification) async { guard applicationState == .inactive else { return From aeb02b5e812ff444629936832e56e223f205c515 Mon Sep 17 00:00:00 2001 From: Evgeny Aleksandrov Date: Fri, 4 Nov 2022 21:55:18 +0300 Subject: [PATCH 2/2] Remove condition in notification deeplink --- WooCommerce/Classes/ViewRelated/MainTabBarController.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/MainTabBarController.swift b/WooCommerce/Classes/ViewRelated/MainTabBarController.swift index 93e245a91f4..ed25658deb2 100644 --- a/WooCommerce/Classes/ViewRelated/MainTabBarController.swift +++ b/WooCommerce/Classes/ViewRelated/MainTabBarController.swift @@ -337,10 +337,8 @@ extension MainTabBarController { } let siteID = Int64(note.meta.identifier(forKey: .site) ?? Int.min) - switchToStore(with: siteID, onCompletion: { siteChanged in - if siteChanged { - presentNotificationDetails(for: note) - } + switchToStore(with: siteID, onCompletion: { _ in + presentNotificationDetails(for: note) }) } ServiceLocator.stores.dispatch(action)