Fix: frontend handle autocomplete failure gracefully (#4903)

This commit is contained in:
shamoon authored and GitHub committed 2023-12-11 15:41:40 +00:00
1 parent 7b7a74d821
commit 7ecf7f704a
2 files changed
+24 -2

No files matched your search

@@ -8,6 +8,7 @@ import {
map,
switchMap,
first,
catchError,
} from 'rxjs/operators'
import { PaperlessDocument } from 'src/app/data/paperless-document'
import { OpenDocumentsService } from 'src/app/services/open-documents.service'
@@ -166,7 +167,13 @@ export class AppFrameComponent
}
}),
switchMap((term) =>
term.length < 2 ? from([[]]) : this.searchService.autocomplete(term)
term.length < 2
? from([[]])
: this.searchService.autocomplete(term).pipe(
catchError(() => {
return from([[]])
})
)
)
)