1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

Separate Autotype Setting Observable (#16521)

* Update the default autotype user setting to be separately represented

* rxjs update

* settings.component.spec.ts update
This commit is contained in:
Colton Hurst
2025-09-22 19:08:11 -04:00
committed by GitHub
parent bb119fa315
commit 3ca1395472
3 changed files with 5 additions and 1 deletions

View File

@@ -182,6 +182,7 @@ describe("SettingsComponent", () => {
pinServiceAbstraction.isPinSet.mockResolvedValue(false);
policyService.policiesByType$.mockReturnValue(of([null]));
desktopAutotypeService.resolvedAutotypeEnabled$ = of(false);
desktopAutotypeService.autotypeEnabledUserSetting$ = of(false);
billingAccountProfileStateService.hasPremiumFromAnySource$.mockReturnValue(of(false));
configService.getFeatureFlag$.mockReturnValue(of(true));
});

View File

@@ -391,7 +391,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
this.desktopSettingsService.sshAgentPromptBehavior$,
),
allowScreenshots: !(await firstValueFrom(this.desktopSettingsService.preventScreenshots$)),
enableAutotype: await firstValueFrom(this.desktopAutotypeService.resolvedAutotypeEnabled$),
enableAutotype: await firstValueFrom(this.desktopAutotypeService.autotypeEnabledUserSetting$),
theme: await firstValueFrom(this.themeStateService.selectedTheme$),
locale: await firstValueFrom(this.i18nService.userSetLocale$),
};

View File

@@ -26,6 +26,7 @@ export const AUTOTYPE_ENABLED = new KeyDefinition<boolean>(
export class DesktopAutotypeService {
private readonly autotypeEnabledState = this.globalStateProvider.get(AUTOTYPE_ENABLED);
autotypeEnabledUserSetting$: Observable<boolean> = of(false);
resolvedAutotypeEnabled$: Observable<boolean> = of(false);
constructor(
@@ -49,6 +50,8 @@ export class DesktopAutotypeService {
}
async init() {
this.autotypeEnabledUserSetting$ = this.autotypeEnabledState.state$;
if (this.platformUtilsService.getDevice() === DeviceType.WindowsDesktop) {
this.resolvedAutotypeEnabled$ = combineLatest([
this.autotypeEnabledState.state$,