mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
[PM-26666] Timeout setting error (#16812)
* do not show organization error message for any invalid timeout * use newValue rather than the current form value when early return * add missing error message
This commit is contained in:
@@ -629,7 +629,6 @@ describe("SettingsComponent", () => {
|
||||
});
|
||||
|
||||
it("should not save vault timeout when vault timeout is invalid", async () => {
|
||||
i18nService.t.mockReturnValue("Number too large test error");
|
||||
component["form"].controls.vaultTimeout.setErrors({}, { emitEvent: false });
|
||||
await component.saveVaultTimeout(DEFAULT_VAULT_TIMEOUT, 999_999_999);
|
||||
|
||||
@@ -639,11 +638,6 @@ describe("SettingsComponent", () => {
|
||||
DEFAULT_VAULT_TIMEOUT_ACTION,
|
||||
);
|
||||
expect(component["form"].getRawValue().vaultTimeout).toEqual(DEFAULT_VAULT_TIMEOUT);
|
||||
expect(platformUtilsService.showToast).toHaveBeenCalledWith(
|
||||
"error",
|
||||
null,
|
||||
"Number too large test error",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -510,16 +510,11 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
// Avoid saving 0 since it's useless as a timeout value.
|
||||
if (this.form.value.vaultTimeout === 0) {
|
||||
if (newValue === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.form.controls.vaultTimeout.valid) {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
null,
|
||||
this.i18nService.t("vaultTimeoutTooLarge"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2549,6 +2549,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"vaultCustomTimeoutMinimum": {
|
||||
"message": "Minimum custom timeout is 1 minute."
|
||||
},
|
||||
"inviteAccepted": {
|
||||
"message": "Invitation accepted"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user