1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01:00

Debounce value changes (#5244)

This value change was triggering multiple times on a single
change. Others in file are not.
This commit is contained in:
Matt Gibson 2023-04-20 13:46:24 -04:00 committed by GitHub
parent c47194b21c
commit 4fbc8864fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
import { Component, ElementRef, OnInit, ViewChild } from "@angular/core"; import { Component, ElementRef, OnInit, ViewChild } from "@angular/core";
import { FormBuilder } from "@angular/forms"; import { FormBuilder } from "@angular/forms";
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { concatMap, filter, map, Observable, Subject, takeUntil, tap } from "rxjs"; import { concatMap, debounceTime, filter, map, Observable, Subject, takeUntil, tap } from "rxjs";
import Swal from "sweetalert2"; import Swal from "sweetalert2";
import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ModalService } from "@bitwarden/angular/services/modal.service";
@ -155,6 +155,7 @@ export class SettingsComponent implements OnInit {
this.form.controls.vaultTimeout.valueChanges this.form.controls.vaultTimeout.valueChanges
.pipe( .pipe(
debounceTime(250),
concatMap(async (value) => { concatMap(async (value) => {
await this.saveVaultTimeout(value); await this.saveVaultTimeout(value);
}), }),