fix(hibp): move the progress pill off the sidebar and abort the scan on toggle-off

The pill was pinned to the left edge and covered the navigation, hiding Trash. It also kept counting after Breach check disabled, the workers carrying on with one network round-trip per entry.
This commit is contained in:
r-zakarya
2026-08-01 20:12:09 +01:00
parent fd03c1da25
commit 961d77534f
3 changed files with 12 additions and 1 deletions
+6
View File
@@ -989,6 +989,10 @@ async function hibpCheckAllEntries() {
for (let w = 0; w < CONCURRENCY; w++) {
workers.push((async () => {
while (queue.length) {
// Stop as soon as the user turns the check off: the scan is one
// network round-trip per entry, and it kept running (and kept
// counting in the pill) after "Breach check disabled".
if (!state.hibpEnabled) return;
const entry = queue.shift();
try {
const pwd = await decryptPwd(entry.encrypted_password, entry.iv);
@@ -1006,6 +1010,8 @@ async function hibpCheckAllEntries() {
}
await Promise.all(workers);
hibpProgress(null);
// Aborted by the toggle: it already cleared the results and refreshed.
if (!state.hibpEnabled) return;
// The health dashboard reads its "pwned" column from state.hibpResults, and
// its cache may well have been computed before these results landed — that
// is exactly what happens when HIBP is switched on from the health view