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).toHaveBeenCalledTimes(1);
|
||||||
expect(browserTaskSchedulerService.setTimeout).toHaveBeenCalledWith(
|
expect(browserTaskSchedulerService.setTimeout).toHaveBeenCalledWith(
|
||||||
expect.any(Function),
|
ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||||
expect.any(Number),
|
expect.any(Number),
|
||||||
ScheduledTaskNames.clearClipboardTimeout,
|
|
||||||
);
|
);
|
||||||
expect(ClearClipboard.run).toHaveBeenCalledTimes(1);
|
expect(ClearClipboard.run).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
@ -15,10 +15,10 @@ export class GeneratePasswordToClipboardCommand {
|
|||||||
constructor(
|
constructor(
|
||||||
private passwordGenerationService: PasswordGenerationServiceAbstraction,
|
private passwordGenerationService: PasswordGenerationServiceAbstraction,
|
||||||
private autofillSettingsService: AutofillSettingsServiceAbstraction,
|
private autofillSettingsService: AutofillSettingsServiceAbstraction,
|
||||||
private taskSchedulerService: BrowserTaskSchedulerService,
|
private taskSchedulerService?: BrowserTaskSchedulerService,
|
||||||
) {
|
) {
|
||||||
void this.taskSchedulerService.registerTaskHandler(
|
void this.taskSchedulerService?.registerTaskHandler(
|
||||||
ScheduledTaskNames.clearClipboardTimeout,
|
ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||||
() => ClearClipboard.run(),
|
() => ClearClipboard.run(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -39,12 +39,12 @@ export class GeneratePasswordToClipboardCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const timeoutInMs = clearClipboardDelayInSeconds * 1000;
|
const timeoutInMs = clearClipboardDelayInSeconds * 1000;
|
||||||
await this.taskSchedulerService.clearScheduledTask({
|
await this.taskSchedulerService?.clearScheduledTask({
|
||||||
taskName: ScheduledTaskNames.clearClipboardTimeout,
|
taskName: ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||||
timeoutId: this.clearClipboardTimeout,
|
timeoutId: this.clearClipboardTimeout,
|
||||||
});
|
});
|
||||||
await this.taskSchedulerService.setTimeout(
|
await this.taskSchedulerService?.setTimeout(
|
||||||
ScheduledTaskNames.clearClipboardTimeout,
|
ScheduledTaskNames.generatePasswordClearClipboardTimeout,
|
||||||
timeoutInMs,
|
timeoutInMs,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export const ScheduledTaskNames = {
|
export const ScheduledTaskNames = {
|
||||||
clearClipboardTimeout: "clearClipboardTimeout",
|
generatePasswordClearClipboardTimeout: "generatePasswordClearClipboardTimeout",
|
||||||
systemClearClipboardTimeout: "systemClearClipboardTimeout",
|
systemClearClipboardTimeout: "systemClearClipboardTimeout",
|
||||||
loginStrategySessionTimeout: "loginStrategySessionTimeout",
|
loginStrategySessionTimeout: "loginStrategySessionTimeout",
|
||||||
notificationsReconnectTimeout: "notificationsReconnectTimeout",
|
notificationsReconnectTimeout: "notificationsReconnectTimeout",
|
||||||
|
Loading…
Reference in New Issue
Block a user