Skip to content

Commit 57ab08b

Browse files
dabowmanclaude
andcommitted
Sync connection modal: Hide Retry button for auth errors
Authentication failures can't be resolved by retrying, so hide the manual Retry button for that error code. The auto-retry countdown remains visible since the connection still retries behind the scenes. Copy Post Content promotes to primary when Retry is hidden. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 911b2be commit 57ab08b

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

packages/editor/src/components/sync-connection-modal/index.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function SyncConnectionModal() {
113113
return null;
114114
}
115115

116-
const { title, description } = syncConnectionMessage;
116+
const { title, description, canRetry } = syncConnectionMessage;
117117

118118
let retryCountdownText;
119119
if ( secondsRemaining > 0 ) {
@@ -173,21 +173,23 @@ export function SyncConnectionModal() {
173173
<Button
174174
__next40pxDefaultSize
175175
ref={ copyButtonRef }
176-
variant="secondary"
176+
variant={ canRetry ? 'secondary' : 'primary' }
177177
>
178178
{ __( 'Copy Post Content' ) }
179179
</Button>
180-
<Button
181-
__next40pxDefaultSize
182-
isBusy={ isRetrying }
183-
variant="primary"
184-
onClick={ () => {
185-
markRetrying();
186-
retrySyncConnection();
187-
} }
188-
>
189-
{ __( 'Retry' ) }
190-
</Button>
180+
{ canRetry && (
181+
<Button
182+
__next40pxDefaultSize
183+
isBusy={ isRetrying }
184+
variant="primary"
185+
onClick={ () => {
186+
markRetrying();
187+
retrySyncConnection();
188+
} }
189+
>
190+
{ __( 'Retry' ) }
191+
</Button>
192+
) }
191193
</HStack>
192194
</VStack>
193195
</Modal>

packages/editor/src/utils/sync-error-messages.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,31 @@ const ERROR_MESSAGES = {
1313
"Real-time collaboration couldn't verify your permissions. " +
1414
'Check that you have access to edit this post, or contact your site administrator.'
1515
),
16+
canRetry: false,
1617
},
1718
'connection-expired': {
1819
title: __( 'Connection expired' ),
1920
description: __(
2021
'Your connection to real-time collaboration has timed out. ' +
2122
'Editing is paused to prevent conflicts with other editors.'
2223
),
24+
canRetry: true,
2325
},
2426
'connection-limit-exceeded': {
2527
title: __( 'Too many editors connected' ),
2628
description: __(
2729
'Real-time collaboration has reached its connection limit. ' +
2830
'Try again later or contact your site administrator.'
2931
),
32+
canRetry: true,
3033
},
3134
'unknown-error': {
3235
title: __( 'Connection lost' ),
3336
description: __(
3437
'The connection to real-time collaboration was interrupted. ' +
3538
'Editing is paused to prevent conflicts with other editors.'
3639
),
40+
canRetry: true,
3741
},
3842
};
3943

0 commit comments

Comments
 (0)