Fix duplicate compare modal on repeated clicks (#491)

Co-authored-by: cosminae <cosmin.e@annavas.io>
This commit is contained in:
Cosmin Enache
2026-06-01 15:24:27 +02:00
committed by GitHub
parent 1eff46579a
commit 04fd963394
3 changed files with 9 additions and 0 deletions

View File

@@ -92,7 +92,9 @@ async function toggleMode() {
deactivate(true);
return false;
}
if (state._openingSelector) return false;
state._openingSelector = true;
try {
const confirmed = await showModelSelector();
if (!confirmed) return false;
@@ -104,6 +106,8 @@ async function toggleMode() {
} catch (err) {
console.error('Compare toggleMode error:', err);
return false;
} finally {
state._openingSelector = false;
}
}