1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-21 21:11:35 +01:00

prevent duplicate cache deletes in browser

This commit is contained in:
Jacob Fink 2023-06-30 11:11:11 -04:00
parent 301028f8db
commit e66ae53bf9
No known key found for this signature in database
GPG Key ID: C2F7ACF05859D008

View File

@ -167,4 +167,17 @@ export class BrowserStateService
this.reconcileOptions(options, await this.defaultInMemoryOptions())
);
}
// Overriding the base class to prevent deleting the cache on save. We register a storage listener
// to delete the cache in the constructor above.
protected override async saveAccountToDisk(
account: Account,
options: StorageOptions
): Promise<void> {
const storageLocation = options.useSecureStorage
? this.secureStorageService
: this.storageService;
await storageLocation.save(`${options.userId}`, account, options);
}
}