mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Fix browser unsaved changes with custom guard
This commit is contained in:
@@ -92,9 +92,14 @@ export class OpenDocumentsService {
|
||||
}
|
||||
}
|
||||
|
||||
setDirty(documentId: number, dirty: boolean) {
|
||||
if (dirty) this.dirtyDocuments.add(documentId)
|
||||
else this.dirtyDocuments.delete(documentId)
|
||||
setDirty(doc: PaperlessDocument, dirty: boolean) {
|
||||
if (!this.openDocuments.find((d) => d.id == doc.id)) return
|
||||
if (dirty) this.dirtyDocuments.add(doc.id)
|
||||
else this.dirtyDocuments.delete(doc.id)
|
||||
}
|
||||
|
||||
hasDirty(): boolean {
|
||||
return this.dirtyDocuments.size > 0
|
||||
}
|
||||
|
||||
closeDocument(doc: PaperlessDocument): Observable<boolean> {
|
||||
|
Reference in New Issue
Block a user