diff --git a/apps/desktop/src/autofill/services/desktop-autotype.service.ts b/apps/desktop/src/autofill/services/desktop-autotype.service.ts index c92cb5f1289..22eb5ae414f 100644 --- a/apps/desktop/src/autofill/services/desktop-autotype.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autotype.service.ts @@ -2,6 +2,7 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { combineLatest, concatMap, + distinctUntilChanged, filter, firstValueFrom, map, @@ -158,13 +159,15 @@ export class DesktopAutotypeService { ), ]) .pipe( - concatMap(async ([settingsEnabled, ffEnabled, authStatus, hasPremium]) => { - const enabled = + map( + ([settingsEnabled, ffEnabled, authStatus, hasPremium]) => settingsEnabled && ffEnabled && authStatus == AuthenticationStatus.Unlocked && - hasPremium; - + hasPremium, + ), + distinctUntilChanged(), // Only emit when the boolean result changes + concatMap(async (enabled) => { ipc.autofill.toggleAutotype(enabled); }), takeUntilDestroyed(),