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:
@@ -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));
|
||||
});
|
||||
|
||||
@@ -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$),
|
||||
};
|
||||
|
||||
@@ -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$,
|
||||
|
||||
Reference in New Issue
Block a user