diff --git a/webapp/src/lib/api/backup.ts b/webapp/src/lib/api/backup.ts index b76cb5a..4bb6ea1 100644 --- a/webapp/src/lib/api/backup.ts +++ b/webapp/src/lib/api/backup.ts @@ -197,7 +197,7 @@ export async function downloadAdminBackupAttachmentBlob( authedFetch: AuthedFetch, blobName: string, masterPasswordHash: string -): Promise { +): Promise> { const resp = await authedFetch('/api/admin/backup/blob', { method: 'POST', headers: { 'Content-Type': 'application/json' }, diff --git a/webapp/src/lib/backup-center.ts b/webapp/src/lib/backup-center.ts index e2cb815..87255fd 100644 --- a/webapp/src/lib/backup-center.ts +++ b/webapp/src/lib/backup-center.ts @@ -186,7 +186,7 @@ export function invalidateRemoteBrowserCacheForDestination( cache: Record, pathByDestination: Record, pageByKey: Record -): PersistedRemoteBrowserState { +): Omit { return { cache: Object.fromEntries(Object.entries(cache).filter(([key]) => !key.startsWith(`${destinationId}:`))), pathByDestination: Object.fromEntries(Object.entries(pathByDestination).filter(([key]) => key !== destinationId)), diff --git a/webapp/src/lib/password-security-cache.ts b/webapp/src/lib/password-security-cache.ts index 7c74c31..0e6d310 100644 --- a/webapp/src/lib/password-security-cache.ts +++ b/webapp/src/lib/password-security-cache.ts @@ -23,7 +23,7 @@ function createState(fingerprint: string): InternalPasswordSecurityState { return { fingerprint, report: null, scannedAt: null, scanning: false, progress: { checked: 0, total: 0 }, scanError: false, controller: null }; } -export function getPasswordSecurityState(fingerprint: string): PasswordSecurityState { +function ensurePasswordSecurityState(fingerprint: string): InternalPasswordSecurityState { if (state?.fingerprint !== fingerprint) { state?.controller?.abort(); state = createState(fingerprint); @@ -31,6 +31,10 @@ export function getPasswordSecurityState(fingerprint: string): PasswordSecurityS return state; } +export function getPasswordSecurityState(fingerprint: string): PasswordSecurityState { + return ensurePasswordSecurityState(fingerprint); +} + export function readPasswordSecurityState(fingerprint: string): PasswordSecurityState | null { return state?.fingerprint === fingerprint ? state : null; } @@ -41,7 +45,7 @@ export function subscribePasswordSecurityState(listener: () => void): () => void } export function startPasswordSecurityScan(fingerprint: string, ciphers: Cipher[]): void { - const current = getPasswordSecurityState(fingerprint); + const current = ensurePasswordSecurityState(fingerprint); current.controller?.abort(); const controller = new AbortController(); const total = ciphers.filter((cipher) => Number(cipher.type) === 1 && !cipher.deletedDate && !(cipher as { deletedAt?: string | null }).deletedAt && !!cipher.login?.decPassword).length;