Do not switch accounts if it is already the active account (#1229)

This commit is contained in:
Daniel James Smith 2022-01-12 17:20:07 +01:00 committed by GitHub
parent f32b917a9f
commit d885e3296b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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: {