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
1 changed files with 2 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import { Component, ElementRef, OnInit, ViewChild } from "@angular/core";
import { FormBuilder } from "@angular/forms";
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 { ModalService } from "@bitwarden/angular/services/modal.service";
@ -155,6 +155,7 @@ export class SettingsComponent implements OnInit {
this.form.controls.vaultTimeout.valueChanges
.pipe(
debounceTime(250),
concatMap(async (value) => {
await this.saveVaultTimeout(value);
}),