mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
Add hasLoggedInAccount to check if there is a logged in account
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<ng-container slot="end">
|
<ng-container slot="end">
|
||||||
<app-pop-out></app-pop-out>
|
<app-pop-out></app-pop-out>
|
||||||
<app-current-account *ngIf="showAcctSwitcher"></app-current-account>
|
<app-current-account *ngIf="showAcctSwitcher && hasLoggedInAccount"></app-current-account>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</popup-header>
|
</popup-header>
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { PopOutComponent } from "../../../platform/popup/components/pop-out.comp
|
|||||||
import { PopupHeaderComponent } from "../../../platform/popup/layout/popup-header.component";
|
import { PopupHeaderComponent } from "../../../platform/popup/layout/popup-header.component";
|
||||||
import { PopupPageComponent } from "../../../platform/popup/layout/popup-page.component";
|
import { PopupPageComponent } from "../../../platform/popup/layout/popup-page.component";
|
||||||
import { CurrentAccountComponent } from "../account-switching/current-account.component";
|
import { CurrentAccountComponent } from "../account-switching/current-account.component";
|
||||||
|
import { AccountSwitcherService } from "../account-switching/services/account-switcher.service";
|
||||||
|
|
||||||
import { ExtensionBitwardenLogo } from "./extension-bitwarden-logo.icon";
|
import { ExtensionBitwardenLogo } from "./extension-bitwarden-logo.icon";
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
|
|||||||
protected pageIcon: Icon;
|
protected pageIcon: Icon;
|
||||||
protected showReadonlyHostname: boolean;
|
protected showReadonlyHostname: boolean;
|
||||||
protected maxWidth: "md" | "3xl";
|
protected maxWidth: "md" | "3xl";
|
||||||
|
protected hasLoggedInAccount: boolean = false;
|
||||||
|
|
||||||
protected theme: string;
|
protected theme: string;
|
||||||
protected logo = ExtensionBitwardenLogo;
|
protected logo = ExtensionBitwardenLogo;
|
||||||
@@ -59,6 +61,7 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
|
|||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private extensionAnonLayoutWrapperDataService: AnonLayoutWrapperDataService,
|
private extensionAnonLayoutWrapperDataService: AnonLayoutWrapperDataService,
|
||||||
|
private accountSwitcherService: AccountSwitcherService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit(): Promise<void> {
|
async ngOnInit(): Promise<void> {
|
||||||
@@ -68,6 +71,12 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
|
|||||||
// Listen for page changes and update the page data appropriately
|
// Listen for page changes and update the page data appropriately
|
||||||
this.listenForPageDataChanges();
|
this.listenForPageDataChanges();
|
||||||
this.listenForServiceDataChanges();
|
this.listenForServiceDataChanges();
|
||||||
|
|
||||||
|
this.accountSwitcherService.availableAccounts$
|
||||||
|
.pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe((accounts) => {
|
||||||
|
this.hasLoggedInAccount = accounts.some((account) => account.id !== "addAccount");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private listenForPageDataChanges() {
|
private listenForPageDataChanges() {
|
||||||
|
|||||||
Reference in New Issue
Block a user