]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Cancel possibly slow queries on leave doc details 3925/head
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 4 Aug 2023 04:49:11 +0000 (21:49 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Fri, 4 Aug 2023 04:49:11 +0000 (21:49 -0700)
src-ui/src/app/components/document-detail/document-detail.component.ts

index cd402817ae88e87069f93e366860e4534a019fa4..7a385bebeb018081d08da67dd07aa2d172e89efe 100644 (file)
@@ -213,22 +213,22 @@ export class DocumentDetailComponent
 
     this.correspondentService
       .listAll()
-      .pipe(first())
+      .pipe(first(), takeUntil(this.unsubscribeNotifier))
       .subscribe((result) => (this.correspondents = result.results))
 
     this.documentTypeService
       .listAll()
-      .pipe(first())
+      .pipe(first(), takeUntil(this.unsubscribeNotifier))
       .subscribe((result) => (this.documentTypes = result.results))
 
     this.storagePathService
       .listAll()
-      .pipe(first())
+      .pipe(first(), takeUntil(this.unsubscribeNotifier))
       .subscribe((result) => (this.storagePaths = result.results))
 
     this.userService
       .listAll()
-      .pipe(first())
+      .pipe(first(), takeUntil(this.unsubscribeNotifier))
       .subscribe((result) => (this.users = result.results))
 
     this.route.paramMap
@@ -406,7 +406,7 @@ export class DocumentDetailComponent
     ) {
       this.documentsService
         .getSuggestions(doc.id)
-        .pipe(first())
+        .pipe(first(), takeUntil(this.unsubscribeNotifier))
         .subscribe({
           next: (result) => {
             this.suggestions = result