1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 11:43:51 +00:00

[PM-22789] Refactor autotype service observables

This commit is contained in:
Colton Hurst
2025-07-30 17:24:09 -04:00
parent a16a2b3366
commit 7fa9502b5b

View File

@@ -48,14 +48,13 @@ export class DesktopAutotypeService {
async init() {
if (this.platformUtilsService.getDevice() === DeviceType.WindowsDesktop) {
const userId = await firstValueFrom(
this.accountService.activeAccount$.pipe(map((a) => a?.id)),
);
this.autotypeEnabled$ = combineLatest([
this.autotypeEnabledState.state$,
this.configService.getFeatureFlag$(FeatureFlag.WindowsDesktopAutotype),
this.authService.authStatusFor$(userId),
this.accountService.activeAccount$.pipe(
map((account) => account?.id),
switchMap((userId) => this.authService.authStatusFor$(userId)),
),
]).pipe(
map(
([autotypeEnabled, windowsDesktopAutotypeFeatureFlag, authStatus]) =>