]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Prettier code cleanup for PR #273 276/head
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Fri, 11 Mar 2022 20:00:31 +0000 (12:00 -0800)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Fri, 11 Mar 2022 20:00:31 +0000 (12:00 -0800)
src-ui/src/app/components/document-detail/document-detail.component.ts
src-ui/src/app/services/document-list-view.service.ts

index dcafa69257382e0f25590952b146626014099d79..88f77160a9d33f2b9c7c809ddb96a4686f350125 100644 (file)
@@ -433,15 +433,19 @@ export class DocumentDetailComponent
   }
 
   nextDoc() {
-    this.documentListViewService.getNext(this.document.id).subscribe((nextDocId: number) => {
-      this.router.navigate(['documents', nextDocId])
-    })
+    this.documentListViewService
+      .getNext(this.document.id)
+      .subscribe((nextDocId: number) => {
+        this.router.navigate(['documents', nextDocId])
+      })
   }
-  
-  previousDoc () {
-    this.documentListViewService.getPrevious(this.document.id).subscribe((prevDocId: number) => {
-      this.router.navigate(['documents', prevDocId])
-    })
+
+  previousDoc() {
+    this.documentListViewService
+      .getPrevious(this.document.id)
+      .subscribe((prevDocId: number) => {
+        this.router.navigate(['documents', prevDocId])
+      })
   }
 
   pdfPreviewLoaded(pdf: PDFDocumentProxy) {
index a8b7c3d9e246b0988e88ea3928f8820dce4cccb5..a77ce250923bf42fda03dc407234374d13b1d11d 100644 (file)
@@ -282,7 +282,7 @@ export class DocumentListViewService {
 
   hasPrevious(doc: number) {
     if (this.documents) {
-      let index = this.documents.findIndex(d => d.id == doc)
+      let index = this.documents.findIndex((d) => d.id == doc)
       return index != -1 && !(index == 0 && this.currentPage == 1)
     }
   }
@@ -311,13 +311,12 @@ export class DocumentListViewService {
   }
 
   getPrevious(currentDocId: number): Observable<number> {
-    return new Observable(prevDocId => {
+    return new Observable((prevDocId) => {
       if (this.documents != null) {
-
-        let index = this.documents.findIndex(d => d.id == currentDocId)
+        let index = this.documents.findIndex((d) => d.id == currentDocId)
 
         if (index != 0) {
-          prevDocId.next(this.documents[index-1].id)
+          prevDocId.next(this.documents[index - 1].id)
           prevDocId.complete()
         } else if (this.currentPage > 1) {
           this.currentPage -= 1