Skip to content

Commit 7325307

Browse files
committed
fix: keep relay reset migration server-side
1 parent 7e2f145 commit 7325307

2 files changed

Lines changed: 10 additions & 44 deletions

File tree

‎src/web-ui/src/app/components/RemoteConnectDialog/AccountPanel.tsx‎

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,6 @@ export const AccountPanel: React.FC<AccountPanelProps> = ({
734734
startBackgroundSync(lastSyncIsFirstLogin ?? false);
735735
}, [lastSyncIsFirstLogin, startBackgroundSync, syncStatus]);
736736

737-
const handleOverwriteCloudSettings = useCallback(() => {
738-
if (syncStatus !== 'failed' || syncInFlightRef.current) return;
739-
startBackgroundSync(true);
740-
}, [startBackgroundSync, syncStatus]);
741-
742737
/** Landing path after a completed login: devices view + background sync. */
743738
const completeLogin = useCallback((
744739
relayUrl: string,
@@ -1238,29 +1233,16 @@ export const AccountPanel: React.FC<AccountPanelProps> = ({
12381233
{syncStatus === 'failed' && syncFailureMessage(t, lastSyncError)}
12391234
</span>
12401235
{syncStatus === 'failed' && (
1241-
<>
1242-
<Button
1243-
variant="outline"
1244-
size="sm"
1245-
leadingIcon={<Icon name="refresh" size="lg" />}
1246-
className="account-panel__sync-retry"
1247-
onClick={handleRetrySync}
1248-
disabled={loading}
1249-
>
1250-
{t('accountLogin.retrySync')}
1251-
</Button>
1252-
<Button
1253-
variant="outline"
1254-
size="sm"
1255-
leadingIcon={<Icon name="upload" size="lg" />}
1256-
className="account-panel__sync-retry"
1257-
onClick={handleOverwriteCloudSettings}
1258-
disabled={loading}
1259-
title={t('accountLogin.useLocalDesc')}
1260-
>
1261-
{t('accountLogin.useLocalTitle')}
1262-
</Button>
1263-
</>
1236+
<Button
1237+
variant="outline"
1238+
size="sm"
1239+
leadingIcon={<Icon name="refresh" size="lg" />}
1240+
className="account-panel__sync-retry"
1241+
onClick={handleRetrySync}
1242+
disabled={loading}
1243+
>
1244+
{t('accountLogin.retrySync')}
1245+
</Button>
12641246
)}
12651247
{syncStatus === 'syncing' && (
12661248
<span className="account-panel__sync-indicator-percent">

‎src/web-ui/src/app/components/RemoteConnectDialog/RemoteConnectDialog.contract.test.ts‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -239,22 +239,6 @@ describe('Remote Connect safety contracts', () => {
239239
expect(backgroundSync.match(/accountAutoSync/g)).toHaveLength(1);
240240
});
241241

242-
it('offers an explicit local overwrite when a new-format cloud pull cannot be applied', () => {
243-
const overwriteHandler = accountPanelSource.slice(
244-
accountPanelSource.indexOf('const handleOverwriteCloudSettings'),
245-
accountPanelSource.indexOf('/** Landing path after a completed login'),
246-
);
247-
const failedSyncActions = accountPanelSource.slice(
248-
accountPanelSource.indexOf("{syncStatus === 'failed' && ("),
249-
accountPanelSource.indexOf("{syncStatus === 'syncing' && ("),
250-
);
251-
252-
expect(overwriteHandler).toContain('startBackgroundSync(true)');
253-
expect(failedSyncActions).toContain('handleOverwriteCloudSettings');
254-
expect(failedSyncActions).toContain("accountLogin.useLocalTitle");
255-
expect(failedSyncActions).toContain("accountLogin.useLocalDesc");
256-
});
257-
258242
it('binds overwrite finalize and cleanup to an opaque pending login id', () => {
259243
expect(accountPanelSource).toContain('pendingLoginIdRef.current = result.pending_login_id');
260244
expect(accountPanelSource).toContain('accountFinalizeLogin(pendingLoginId)');

0 commit comments

Comments
 (0)