diff --git a/plugins/woocommerce-admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx b/plugins/woocommerce-admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx index f8d1308f2ca..68d89e5b383 100644 --- a/plugins/woocommerce-admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx +++ b/plugins/woocommerce-admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx @@ -89,8 +89,7 @@ export const useJetpackPluginState = () => { ); } else if ( jetpackConnectionData && - jetpackConnectionData?.currentUser?.username !== - jetpackConnectionData?.connectionOwner + ! jetpackConnectionData?.currentUser?.isMaster ) { setPluginState( JetpackPluginStates.NOT_OWNER_OF_CONNECTION diff --git a/plugins/woocommerce/changelog/fix-mobile-app-connection-owner-bug b/plugins/woocommerce/changelog/fix-mobile-app-connection-owner-bug new file mode 100644 index 00000000000..b3f987f0f3e --- /dev/null +++ b/plugins/woocommerce/changelog/fix-mobile-app-connection-owner-bug @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +fixed bug where jetpack connection owner field was assumed to be username when its actually display name diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/GetMobileApp.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/GetMobileApp.php index 8e0c9548327..e03b880ba5b 100644 --- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/GetMobileApp.php +++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/GetMobileApp.php @@ -90,7 +90,7 @@ class GetMobileApp extends Task { private static function is_current_user_connected() { if ( class_exists( '\Automattic\Jetpack\Connection\Manager' ) && method_exists( '\Automattic\Jetpack\Connection\Manager', 'is_user_connected' ) ) { $connection = new Manager(); - return $connection->is_user_connected(); + return $connection->is_connection_owner(); } return false; }