Optimize state loading

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/14/head
trivernis 3 years ago
parent 296591a985
commit f788d195eb
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1361,7 +1361,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "mediarepo-api"
version = "0.30.0"
version = "0.31.0"
dependencies = [
"bromine",
"chrono",

@ -1500,7 +1500,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "mediarepo-api"
version = "0.30.0"
version = "0.31.0"
dependencies = [
"async-trait",
"bromine",

@ -1,4 +1,4 @@
import {BehaviorSubject} from "rxjs";
import {BehaviorSubject, skip} from "rxjs";
import {TabCategory} from "./TabCategory";
import {File} from "../../../api/models/File";
import {SortKey} from "../../../api/models/SortKey";
@ -89,9 +89,13 @@ export class FilesTabState extends TabState implements SaveState<FilesTabSaveSta
}
private subscribe() {
this.filters.pipe(debounceTime(500))
this.filters
.pipe(skip(1))
.pipe(debounceTime(500))
.subscribe(async () => await this.findFiles());
this.sortingPreset.pipe(debounceTime(100))
this.sortingPreset
.pipe(skip(1))
.pipe(debounceTime(100))
.subscribe(async () => await this.findFiles());
}
}

Loading…
Cancel
Save