From d885e3296ba7034f0d42c700007647864ef8e490 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Wed, 12 Jan 2022 17:20:07 +0100 Subject: [PATCH] Do not switch accounts if it is already the active account (#1229) --- src/app/layout/account-switcher.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/layout/account-switcher.component.ts b/src/app/layout/account-switcher.component.ts index 7526c7e844..c650a7d34b 100644 --- a/src/app/layout/account-switcher.component.ts +++ b/src/app/layout/account-switcher.component.ts @@ -89,8 +89,12 @@ export class AccountSwitcherComponent implements OnInit { } async switch(userId: string) { - this.messagingService.send("switchAccount", { userId: userId }); this.toggle(); + + if (userId === (await this.stateService.getUserId())) { + return; + } + this.messagingService.send("switchAccount", { userId: userId }); } private async createSwitcherAccounts(baseAccounts: {