fix: lock directory during assignment changes

This commit is contained in:
Bastian Wagner
2026-08-01 10:44:17 +02:00
parent 9dc9dc3dcf
commit 9eec6268d0
3 changed files with 91 additions and 5 deletions

View File

@@ -90,6 +90,7 @@ export class Users {
}
protected submitSearch(): void {
if (this.assignmentBusyUserId() !== null) return;
const search = this.searchDraft().trim();
if (this.loading() && search === this.search() && this.page() === 1) return;
this.search.set(search);
@@ -98,13 +99,13 @@ export class Users {
}
protected previousPage(): void {
if (this.page() <= 1 || this.loading()) return;
if (this.page() <= 1 || this.loading() || this.assignmentBusyUserId() !== null) return;
this.page.update((value) => value - 1);
this.loadDirectory();
}
protected nextPage(): void {
if (!this.directory()?.hasNextPage || this.loading()) return;
if (!this.directory()?.hasNextPage || this.loading() || this.assignmentBusyUserId() !== null) return;
this.page.update((value) => value + 1);
this.loadDirectory();
}