Fix: ensure ui reset of suggestionsLoading when changing docs (#13840)

This commit is contained in:
shamoon
2026-08-28 10:52:30 -07:00
committed by GitHub
parent 00d9bf474a
commit 3a5312ba6f
2 changed files with 24 additions and 4 deletions
@@ -34,6 +34,7 @@ import {
debounceTime,
distinctUntilChanged,
filter,
finalize,
first,
map,
switchMap,
@@ -1016,16 +1017,15 @@ export class DocumentDetailComponent
.pipe(
first(),
takeUntil(this.unsubscribeNotifier),
takeUntil(this.docChangeNotifier)
takeUntil(this.docChangeNotifier),
finalize(() => this.suggestionsLoading.set(false))
)
.subscribe({
next: (result) => {
this.suggestions.set(result)
this.suggestionsLoading.set(false)
},
error: (error) => {
this.suggestions.set(null)
this.suggestionsLoading.set(false)
this.toastService.showError(
$localize`Error retrieving suggestions.`,
error