Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Closing should only navigate if closing current document

Michael Shamoon57c9066f8139
diff --git a/src-ui/src/app/components/app-frame/app-frame.component.ts b/src-ui/src/app/components/app-frame/app-frame.component.ts
index 05b1f3f68..18e30b0cd 100644
--- a/src-ui/src/app/components/app-frame/app-frame.component.ts
+++ b/src-ui/src/app/components/app-frame/app-frame.component.ts
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
-import { from, Observable, Subscription } from 'rxjs';
+import { from, Observable, Subscription, BehaviorSubject } from 'rxjs';
import { debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators';
import { PaperlessDocument } from 'src/app/data/paperless-document';
import { OpenDocumentsService } from 'src/app/services/open-documents.service';
@@ -86,7 +86,7 @@ export class AppFrameComponent implements OnInit {
while (route.firstChild) {
route = route.firstChild
}
- if (route.component == DocumentDetailComponent) {
+ if (route.component == DocumentDetailComponent && (route.params as BehaviorSubject).getValue()['id'] == d.id) {
this.router.navigate([""])
}
}