From 8719b4731821ff1f6ec3743919936995e565c6ef Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Mon, 13 Jan 2025 17:55:51 +0530 Subject: [PATCH] Social | Fix connect button for broken connections --- .../changelog/fix-social-broken-connections-button | 4 ++++ .../src/components/services/service-item.tsx | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 projects/js-packages/publicize-components/changelog/fix-social-broken-connections-button diff --git a/projects/js-packages/publicize-components/changelog/fix-social-broken-connections-button b/projects/js-packages/publicize-components/changelog/fix-social-broken-connections-button new file mode 100644 index 0000000000000..346a7db3a1f58 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/fix-social-broken-connections-button @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fixed fix connection button label for broken connections diff --git a/projects/js-packages/publicize-components/src/components/services/service-item.tsx b/projects/js-packages/publicize-components/src/components/services/service-item.tsx index 27bcc8f2f142c..56e2322786610 100644 --- a/projects/js-packages/publicize-components/src/components/services/service-item.tsx +++ b/projects/js-packages/publicize-components/src/components/services/service-item.tsx @@ -42,11 +42,14 @@ export function ServiceItem( { const brokenConnections = serviceConnections.filter( ( { status } ) => status === 'broken' ); - const hasOwnBrokenConnections = useSelect( select => { - const { canUserManageConnection, getBrokenConnections } = select( socialStore ); + const hasOwnBrokenConnections = useSelect( + select => { + const { canUserManageConnection } = select( socialStore ); - return getBrokenConnections().some( canUserManageConnection ); - }, [] ); + return brokenConnections.some( canUserManageConnection ); + }, + [ brokenConnections ] + ); const hideInitialConnectForm = // For services with custom inputs, the initial Connect button opens the panel,