1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-29 22:53:44 +00:00

clean up and remove distinctUntilChanged

This commit is contained in:
neuronull
2025-11-03 10:34:15 -07:00
parent 949a39864b
commit 7fb19a49d0

View File

@@ -2,7 +2,6 @@ import { Injectable, OnDestroy } from "@angular/core";
import {
combineLatest,
concatMap,
distinctUntilChanged,
filter,
firstValueFrom,
map,
@@ -90,7 +89,6 @@ export class DesktopAutotypeService implements OnDestroy {
this.autotypeEnabledUserSetting$ = this.autotypeEnabledState.state$.pipe(
map((enabled) => enabled ?? false),
takeUntil(this.destroy$),
// distinctUntilChanged(), // Only emit when the result changes
);
this.isPremiumAccount$ = this.accountService.activeAccount$.pipe(
@@ -182,24 +180,16 @@ export class DesktopAutotypeService implements OnDestroy {
this.configService.getFeatureFlag$(FeatureFlag.WindowsDesktopAutotype),
// if there is an active account with an unlocked vault
this.authService.activeAccountStatus$,
// if the active user's account is Premium
this.isPremiumAccount$,
// if the user's account is Premium
// this.accountService.activeAccount$.pipe(
// filter((account): account is Account => !!account),
// switchMap((account) =>
// this.billingAccountProfileStateService.hasPremiumFromAnySource$(account.id),
// ),
// ),
]).pipe(
map(
([settingsEnabled, ffEnabled, authStatus, isPremiumAcct]) =>
// ([settingsEnabled, ffEnabled, authStatus]) =>
settingsEnabled &&
ffEnabled &&
authStatus === AuthenticationStatus.Unlocked &&
isPremiumAcct,
),
distinctUntilChanged(), // Only emit when the boolean result changes
takeUntil(this.destroy$),
);
}