1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-6383] Migrate clearClipboard account setting to autofill settings service (#8022)

* migrate clearClipboard account setting to autofill settings state provider

* replace state service get/set clearClipboard with autofill settings service equivalents

* PR suggestions cleanup
This commit is contained in:
Jonathan Prusik
2024-02-23 13:52:13 -05:00
committed by GitHub
parent 38e40a0471
commit 34a8d9af86
17 changed files with 365 additions and 61 deletions

View File

@@ -10,6 +10,7 @@ import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vaul
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { PolicyType } from "@bitwarden/common/admin-console/enums";
import { UserVerificationService as UserVerificationServiceAbstraction } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
import { AutofillSettingsServiceAbstraction } from "@bitwarden/common/autofill/services/autofill-settings.service";
import { DeviceType } from "@bitwarden/common/enums";
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
@@ -81,7 +82,7 @@ export class SettingsComponent implements OnInit {
requirePasswordOnStart: false,
approveLoginRequests: false,
// Account Preferences
clearClipboard: [null as number | null],
clearClipboard: [null],
minimizeOnCopyToClipboard: false,
enableFavicons: false,
// App Settings
@@ -111,6 +112,7 @@ export class SettingsComponent implements OnInit {
private platformUtilsService: PlatformUtilsService,
private vaultTimeoutSettingsService: VaultTimeoutSettingsService,
private stateService: StateService,
private autofillSettingsService: AutofillSettingsServiceAbstraction,
private messagingService: MessagingService,
private cryptoService: CryptoService,
private modalService: ModalService,
@@ -247,7 +249,7 @@ export class SettingsComponent implements OnInit {
this.biometricStateService.requirePasswordOnStart$,
),
approveLoginRequests: (await this.stateService.getApproveLoginRequests()) ?? false,
clearClipboard: await this.stateService.getClearClipboard(),
clearClipboard: await firstValueFrom(this.autofillSettingsService.clearClipboardDelay$),
minimizeOnCopyToClipboard: await this.stateService.getMinimizeOnCopyToClipboard(),
enableFavicons: !(await this.stateService.getDisableFavicon()),
enableTray: await this.stateService.getEnableTray(),
@@ -563,7 +565,7 @@ export class SettingsComponent implements OnInit {
}
async saveClearClipboard() {
await this.stateService.setClearClipboard(this.form.value.clearClipboard);
await this.autofillSettingsService.setClearClipboardDelay(this.form.value.clearClipboard);
}
async saveAlwaysShowDock() {