mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-08 19:18:02 +01:00
Fix storage reseed on logout
The check for the set vault-timeout needs to happen before all cleaning stateService Remove check inside of reseedStorage as happens outside prior to calling it (logout/settings.component)
This commit is contained in:
parent
e2c25c6aad
commit
35b480af5b
@ -678,6 +678,9 @@ export default class MainBackground {
|
||||
this.vaultFilterService.clear(),
|
||||
]);
|
||||
|
||||
//Needs to be checked before state is cleaned
|
||||
const needStorageReseed = await this.needsStorageReseed();
|
||||
|
||||
await this.stateService.clean({ userId: userId });
|
||||
|
||||
if (userId == null || userId === (await this.stateService.getUserId())) {
|
||||
@ -685,17 +688,25 @@ export default class MainBackground {
|
||||
this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId });
|
||||
}
|
||||
|
||||
if (needStorageReseed) {
|
||||
await this.reseedStorage();
|
||||
}
|
||||
|
||||
if (BrowserApi.manifestVersion === 3) {
|
||||
BrowserApi.sendMessage("updateBadge");
|
||||
}
|
||||
await this.refreshBadge();
|
||||
await this.mainContextMenuHandler.noAccess();
|
||||
await this.reseedStorage();
|
||||
this.notificationsService.updateConnection(false);
|
||||
await this.systemService.clearPendingClipboard();
|
||||
await this.systemService.startProcessReload(this.authService);
|
||||
}
|
||||
|
||||
private async needsStorageReseed(): Promise<boolean> {
|
||||
const currentVaultTimeout = await this.stateService.getVaultTimeout();
|
||||
return currentVaultTimeout == null ? false : true;
|
||||
}
|
||||
|
||||
async collectPageDetailsForContentScript(tab: any, sender: string, frameId: number = null) {
|
||||
if (tab == null || !tab.id) {
|
||||
return;
|
||||
@ -736,11 +747,6 @@ export default class MainBackground {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentVaultTimeout = await this.stateService.getVaultTimeout();
|
||||
if (currentVaultTimeout == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const getStorage = (): Promise<any> =>
|
||||
new Promise((resolve) => {
|
||||
chrome.storage.local.get(null, (o: any) => resolve(o));
|
||||
|
Loading…
Reference in New Issue
Block a user