fix: prevent onBlur race cancelling unlink confirmation

Add 150ms delay before resetting confirmation state so the click
event fires before blur resets it.
This commit is contained in:
Fringg
2026-03-04 15:35:45 +03:00
parent d0c01a0e5c
commit 3418ba9b8d

View File

@@ -199,7 +199,10 @@ export default function ConnectedAccounts() {
}
onClick={() => handleUnlink(provider.provider)}
onBlur={() => {
if (confirmingUnlink === provider.provider) setConfirmingUnlink(null);
// Delay so click on the same button fires before blur resets state
setTimeout(() => {
setConfirmingUnlink((cur) => (cur === provider.provider ? null : cur));
}, 150);
}}
>
{confirmingUnlink === provider.provider