Do not early return from logout (#7147)

The subsequent path helps to trigger process reload when the active user
logs out and the new active is locked.
This commit is contained in:
Matt Gibson 2023-12-11 15:19:56 -05:00 committed by GitHub
parent e70759295d
commit 33fd7094ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -891,17 +891,16 @@ export default class MainBackground {
//Needs to be checked before state is cleaned //Needs to be checked before state is cleaned
const needStorageReseed = await this.needsStorageReseed(); const needStorageReseed = await this.needsStorageReseed();
const currentUserId = await this.stateService.getUserId();
const newActiveUser = await this.stateService.clean({ userId: userId }); const newActiveUser = await this.stateService.clean({ userId: userId });
if (newActiveUser != null) { if (newActiveUser != null) {
// we have a new active user, do not continue tearing down application // we have a new active user, do not continue tearing down application
await this.switchAccount(newActiveUser as UserId); await this.switchAccount(newActiveUser as UserId);
this.messagingService.send("switchAccountFinish"); this.messagingService.send("switchAccountFinish");
this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId });
return;
} }
if (userId == null || userId === (await this.stateService.getUserId())) { if (userId == null || userId === currentUserId) {
this.searchService.clearIndex(); this.searchService.clearIndex();
this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId }); this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId });
} }