mirror of
https://github.com/bitwarden/web
synced 2025-12-12 22:33:23 +00:00
changed implementation
This commit is contained in:
@@ -23,7 +23,6 @@ export class PreferencesComponent implements OnInit {
|
|||||||
vaultTimeouts: { name: string; value: number }[];
|
vaultTimeouts: { name: string; value: number }[];
|
||||||
localeOptions: any[];
|
localeOptions: any[];
|
||||||
themeOptions: any[];
|
themeOptions: any[];
|
||||||
static MIN_CUSTOM_MINUTES = 1;
|
|
||||||
|
|
||||||
vaultTimeout: FormControl = new FormControl(null);
|
vaultTimeout: FormControl = new FormControl(null);
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ export class PreferencesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.vaultTimeout.value < PreferencesComponent.MIN_CUSTOM_MINUTES) {
|
if (this.vaultTimeout.errors?.minTimeoutError) {
|
||||||
this.platformUtilsService.showToast(
|
this.platformUtilsService.showToast(
|
||||||
"error",
|
"error",
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<small *ngIf="!validMinutes" class="form-text text-danger">
|
<small *ngIf="!getValidMinutesInput()" class="form-text text-danger">
|
||||||
<i class="bwi bwi-error" aria-hidden="true"></i> {{ "vaultCustomTimeoutMinimum" | i18n }}
|
<i class="bwi bwi-error" aria-hidden="true"></i> {{ "vaultCustomTimeoutMinimum" | i18n }}
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,4 +19,9 @@ import { VaultTimeoutInputComponent as VaultTimeoutInputComponentBase } from "js
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class VaultTimeoutInputComponent extends VaultTimeoutInputComponentBase {}
|
export class VaultTimeoutInputComponent extends VaultTimeoutInputComponentBase {
|
||||||
|
//checks if input minutes is valid
|
||||||
|
getValidMinutesInput(): boolean {
|
||||||
|
return this.form.get("custom.minutes")?.value > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user