From 07101d83c1c3dd8f230102f01e90eceef949c94b Mon Sep 17 00:00:00 2001 From: Huong Do Date: Tue, 17 Jan 2023 18:24:26 +0700 Subject: [PATCH] Skip setting up push notification if authenticated without WPCom --- WooCommerce/Classes/AppDelegate.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WooCommerce/Classes/AppDelegate.swift b/WooCommerce/Classes/AppDelegate.swift index 33a9e82eab3..60b991fdb08 100644 --- a/WooCommerce/Classes/AppDelegate.swift +++ b/WooCommerce/Classes/AppDelegate.swift @@ -303,7 +303,10 @@ private extension AppDelegate { /// Push Notifications: Authorization + Registration! /// func setupPushNotificationsManagerIfPossible() { - guard ServiceLocator.stores.isAuthenticated, ServiceLocator.stores.needsDefaultStore == false else { + let stores = ServiceLocator.stores + guard stores.isAuthenticated, + stores.needsDefaultStore == false, + stores.isAuthenticatedWithoutWPCom == false else { if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.loginErrorNotifications) { ServiceLocator.pushNotesManager.ensureAuthorizationIsRequested(includesProvisionalAuth: true, onCompletion: nil) }