mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-29 07:59:42 +01:00
[PM-6426] Adjusting name for generate password to clipboard command task name
This commit is contained in:
parent
edf296be46
commit
92a77cf957
@ -62,9 +62,8 @@ describe("GeneratePasswordToClipboardCommand", () => {
|
||||
});
|
||||
expect(browserTaskSchedulerService.setTimeout).toHaveBeenCalledTimes(1);
|
||||
expect(browserTaskSchedulerService.setTimeout).toHaveBeenCalledWith(
|
||||
expect.any(Function),
|
||||
ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||
expect.any(Number),
|
||||
ScheduledTaskNames.clearClipboardTimeout,
|
||||
);
|
||||
expect(ClearClipboard.run).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
@ -15,10 +15,10 @@ export class GeneratePasswordToClipboardCommand {
|
||||
constructor(
|
||||
private passwordGenerationService: PasswordGenerationServiceAbstraction,
|
||||
private autofillSettingsService: AutofillSettingsServiceAbstraction,
|
||||
private taskSchedulerService: BrowserTaskSchedulerService,
|
||||
private taskSchedulerService?: BrowserTaskSchedulerService,
|
||||
) {
|
||||
void this.taskSchedulerService.registerTaskHandler(
|
||||
ScheduledTaskNames.clearClipboardTimeout,
|
||||
void this.taskSchedulerService?.registerTaskHandler(
|
||||
ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||
() => ClearClipboard.run(),
|
||||
);
|
||||
}
|
||||
@ -39,12 +39,12 @@ export class GeneratePasswordToClipboardCommand {
|
||||
}
|
||||
|
||||
const timeoutInMs = clearClipboardDelayInSeconds * 1000;
|
||||
await this.taskSchedulerService.clearScheduledTask({
|
||||
taskName: ScheduledTaskNames.clearClipboardTimeout,
|
||||
await this.taskSchedulerService?.clearScheduledTask({
|
||||
taskName: ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||
timeoutId: this.clearClipboardTimeout,
|
||||
});
|
||||
await this.taskSchedulerService.setTimeout(
|
||||
ScheduledTaskNames.clearClipboardTimeout,
|
||||
await this.taskSchedulerService?.setTimeout(
|
||||
ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||
timeoutInMs,
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export const ScheduledTaskNames = {
|
||||
clearClipboardTimeout: "clearClipboardTimeout",
|
||||
generatePasswordClearClipboardTimeout: "generatePasswordClearClipboardTimeout",
|
||||
systemClearClipboardTimeout: "systemClearClipboardTimeout",
|
||||
loginStrategySessionTimeout: "loginStrategySessionTimeout",
|
||||
notificationsReconnectTimeout: "notificationsReconnectTimeout",
|
||||
|
Loading…
Reference in New Issue
Block a user