]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix missing loadViewConfig breaks loading saved view 1792/head
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Thu, 13 Oct 2022 19:27:41 +0000 (12:27 -0700)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Thu, 13 Oct 2022 19:27:41 +0000 (12:27 -0700)
src-ui/src/app/components/document-list/document-list.component.ts

index fc9ab3ce77452575d4ef9efa7f079c89d9f0d62e..a0c6899f8d01314a64a62003b4a85dd065daea99 100644 (file)
@@ -139,13 +139,7 @@ export class DocumentListComponent implements OnInit, OnDestroy {
       .subscribe((queryParams) => {
         if (queryParams.has('view')) {
           // loading a saved view on /documents
-          this.savedViewService
-            .getCached(parseInt(queryParams.get('view')))
-            .pipe(first())
-            .subscribe((view) => {
-              this.list.activateSavedView(view)
-              this.list.reload()
-            })
+          this.loadViewConfig(parseInt(queryParams.get('view')))
         } else {
           this.list.activateSavedView(null)
           this.list.loadFromQueryParams(queryParams)
@@ -180,6 +174,16 @@ export class DocumentListComponent implements OnInit, OnDestroy {
     }
   }
 
+  loadViewConfig(viewID: number) {
+    this.savedViewService
+      .getCached(viewID)
+      .pipe(first())
+      .subscribe((view) => {
+        this.list.activateSavedView(view)
+        this.list.reload()
+      })
+  }
+
   saveViewConfigAs() {
     let modal = this.modalService.open(SaveViewConfigDialogComponent, {
       backdrop: 'static',