Skip to content

Commit

Permalink
Jetpack Social | Fix admin page connections UI (#34391)
Browse files Browse the repository at this point in the history
* Fix connection data for admin page

* Add changelog
  • Loading branch information
manzoorwanijk authored Dec 4, 2023
1 parent 793e7ef commit a37e593
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions projects/plugins/social/changelog/fix-social-admin-page
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed broken connections UI
5 changes: 3 additions & 2 deletions projects/plugins/social/src/js/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(),
Expand Down

0 comments on commit a37e593

Please sign in to comment.