|
|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, inject } from "@angular/core";
|
|
|
|
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
|
|
|
import { NavigationEnd, Router, RouterOutlet } from "@angular/router";
|
|
|
|
|
import { Subject, takeUntil, firstValueFrom, concatMap, filter, tap, catchError, of } from "rxjs";
|
|
|
|
|
import { Subject, takeUntil, firstValueFrom, concatMap, filter, tap } from "rxjs";
|
|
|
|
|
|
|
|
|
|
import { LogoutReason } from "@bitwarden/auth/common";
|
|
|
|
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
|
|
|
|
@ -71,21 +71,24 @@ export class AppComponent implements OnInit, OnDestroy {
|
|
|
|
|
) {
|
|
|
|
|
if (flagEnabled("sdk")) {
|
|
|
|
|
// Warn if the SDK for some reason can't be initialized
|
|
|
|
|
this.sdkService.supported$
|
|
|
|
|
.pipe(
|
|
|
|
|
takeUntilDestroyed(),
|
|
|
|
|
catchError(() => {
|
|
|
|
|
return of(false);
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
.subscribe((supported) => {
|
|
|
|
|
this.sdkService.supported$.pipe(takeUntilDestroyed()).subscribe({
|
|
|
|
|
next: (supported) => {
|
|
|
|
|
if (!supported) {
|
|
|
|
|
this.logService.debug("SDK is not supported");
|
|
|
|
|
this.sdkService.failedToInitialize().catch((e) => this.logService.error(e));
|
|
|
|
|
this.sdkService
|
|
|
|
|
.failedToInitialize("popup", undefined)
|
|
|
|
|
.catch((e) => this.logService.error(e));
|
|
|
|
|
} else {
|
|
|
|
|
this.logService.debug("SDK is supported");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
error: (e: unknown) => {
|
|
|
|
|
this.sdkService
|
|
|
|
|
.failedToInitialize("popup", e as Error)
|
|
|
|
|
.catch((e) => this.logService.error(e));
|
|
|
|
|
this.logService.error(e);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|