From b45e44eeebd98b2a26d495b37c644b43a384ef81 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Thu, 30 Nov 2023 17:46:26 +0530 Subject: [PATCH 1/2] Fix connection data for admin page --- projects/plugins/social/src/js/components/header/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/plugins/social/src/js/components/header/index.js b/projects/plugins/social/src/js/components/header/index.js index 02b72542b7767..28c9111777cad 100644 --- a/projects/plugins/social/src/js/components/header/index.js +++ b/projects/plugins/social/src/js/components/header/index.js @@ -18,6 +18,7 @@ import StatCards from '../stat-cards'; import styles from './styles.module.scss'; const Header = () => { + const connectionData = window.jetpackSocialInitialState.connectionData ?? {}; const { connectionsAdminUrl, hasConnections, @@ -31,8 +32,8 @@ const Header = () => { } = useSelect( select => { const store = select( SOCIAL_STORE_ID ); return { - connectionsAdminUrl: store.getConnectionsAdminUrl(), - hasConnections: store.hasConnections(), + connectionsAdminUrl: connectionData.adminUrl, + hasConnections: Object.keys( connectionData.connections || {} ).length > 0, hasPaidPlan: select( SOCIAL_STORE_ID ).hasPaidPlan(), isModuleEnabled: store.isModuleEnabled(), isShareLimitEnabled: select( SOCIAL_STORE_ID ).isShareLimitEnabled(), From 2ef69b11b99efa5bf41f0daaf7976b8fd0d227f8 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Thu, 30 Nov 2023 17:47:46 +0530 Subject: [PATCH 2/2] Add changelog --- projects/plugins/social/changelog/fix-social-admin-page | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/plugins/social/changelog/fix-social-admin-page diff --git a/projects/plugins/social/changelog/fix-social-admin-page b/projects/plugins/social/changelog/fix-social-admin-page new file mode 100644 index 0000000000000..011ac1910a4b4 --- /dev/null +++ b/projects/plugins/social/changelog/fix-social-admin-page @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fixed broken connections UI