From 127811166b0ef11a37e995ade6d4a0d5e9020650 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Tue, 13 Aug 2024 15:43:56 +0200 Subject: [PATCH] Revert "[PM-8316] Fix account switcher on logged out account on startup (#10342)" (#10498) This reverts commit 2665afffdda539dd03a1df9a6c43b7a6c8dff2fe. --- apps/browser/src/background/main.background.ts | 12 ------------ .../app/layout/account-switcher.component.ts | 18 ------------------ 2 files changed, 30 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 8fbab335b63..c5f36dfe68b 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1233,18 +1233,6 @@ export default class MainBackground { ); } - // If the user is logged out, switch to the next account - const active = await firstValueFrom(this.accountService.activeAccount$); - if (active == null) { - return; - } - const authStatus = await firstValueFrom( - this.authService.authStatuses$.pipe(map((statuses) => statuses[active.id])), - ); - if (authStatus === AuthenticationStatus.LoggedOut) { - const nextUpAccount = await firstValueFrom(this.accountService.nextUpAccount$); - await this.switchAccount(nextUpAccount?.id); - } await this.initOverlayAndTabsBackground(); return new Promise((resolve) => { diff --git a/apps/desktop/src/app/layout/account-switcher.component.ts b/apps/desktop/src/app/layout/account-switcher.component.ts index 02d98512609..f641d801b8d 100644 --- a/apps/desktop/src/app/layout/account-switcher.component.ts +++ b/apps/desktop/src/app/layout/account-switcher.component.ts @@ -151,24 +151,6 @@ export class AccountSwitcherComponent { ); } - async ngOnInit() { - const active = await firstValueFrom(this.accountService.activeAccount$); - if (active == null) { - return; - } - const authStatus = await firstValueFrom( - this.authService.authStatuses$.pipe(map((statuses) => statuses[active.id])), - ); - if (authStatus === AuthenticationStatus.LoggedOut) { - const nextUpAccount = await firstValueFrom(this.accountService.nextUpAccount$); - if (nextUpAccount != null) { - await this.switch(nextUpAccount.id); - } else { - await this.addAccount(); - } - } - } - toggle() { this.isOpen = !this.isOpen; }