From 7fa9502b5be20c7dceeed8ab5e6d0419ed5f1171 Mon Sep 17 00:00:00 2001 From: Colton Hurst Date: Wed, 30 Jul 2025 17:24:09 -0400 Subject: [PATCH] [PM-22789] Refactor autotype service observables --- .../src/autofill/services/desktop-autotype.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/autofill/services/desktop-autotype.service.ts b/apps/desktop/src/autofill/services/desktop-autotype.service.ts index 1f0cab9766a..65152450a86 100644 --- a/apps/desktop/src/autofill/services/desktop-autotype.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autotype.service.ts @@ -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]) =>