Duplicate identity: user override with Continue Anyway button

When anchor reports duplicate identity, sync pauses and a red banner
shows with a "Continue Anyway" button. Clicking it clears the flag and
starts all sync tasks. Handles false positives from network changes
(WiFi/cellular/VPN switches) without requiring complex staleness checks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Scott Reimers 2026-04-19 15:25:17 -04:00
parent 288b53ffb1
commit 4220674960
2 changed files with 36 additions and 3 deletions

View file

@ -3918,10 +3918,14 @@ async function init() {
if (info && info.duplicateDetected) {
_duplicateWarningShown = true;
const banner = document.createElement('div');
banner.style.cssText = 'position:fixed;top:0;left:0;right:0;background:#c0392b;color:#fff;padding:0.5rem;text-align:center;font-size:0.8rem;z-index:999;';
banner.textContent = 'This identity is active on another device. Sync paused to prevent data conflicts.';
banner.style.cssText = 'position:fixed;top:0;left:0;right:0;background:#c0392b;color:#fff;padding:0.5rem;text-align:center;font-size:0.8rem;z-index:999;display:flex;align-items:center;justify-content:center;gap:0.5rem;';
banner.innerHTML = '<span>This identity may be active on another device. Sync paused.</span><button id="dup-override-btn" style="background:#fff;color:#c0392b;border:none;border-radius:4px;padding:0.2rem 0.6rem;font-size:0.75rem;cursor:pointer">Continue Anyway</button>';
document.body.prepend(banner);
toast('Duplicate identity detected — sync paused');
banner.querySelector('#dup-override-btn').addEventListener('click', async () => {
try { await invoke('clear_duplicate_flag'); } catch (_) {}
banner.remove();
toast('Sync resumed');
});
}
} catch (_) {}
}