mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Reset networkActive & error after switchmap pipes complete
This commit is contained in:
		| @@ -222,13 +222,14 @@ export class DocumentDetailComponent implements OnInit, OnDestroy, DirtyComponen | |||||||
|     this.networkActive = true |     this.networkActive = true | ||||||
|     this.store.next(this.documentForm.value) |     this.store.next(this.documentForm.value) | ||||||
|     this.documentsService.update(this.document).pipe(switchMap(updateResult => { |     this.documentsService.update(this.document).pipe(switchMap(updateResult => { | ||||||
|       this.error = null |  | ||||||
|       return this.documentListViewService.getNext(this.documentId).pipe(map(nextDocId => ({nextDocId, updateResult}))) |       return this.documentListViewService.getNext(this.documentId).pipe(map(nextDocId => ({nextDocId, updateResult}))) | ||||||
|     })).pipe(switchMap(({nextDocId, updateResult}) => { |     })).pipe(switchMap(({nextDocId, updateResult}) => { | ||||||
|       if (nextDocId) return this.openDocumentService.closeDocument(this.document, true).pipe(map(closeResult => ({updateResult, nextDocId, closeResult}))) |       if (nextDocId) return this.openDocumentService.closeDocument(this.document, true).pipe(map(closeResult => ({updateResult, nextDocId, closeResult}))) | ||||||
|     })) |     })) | ||||||
|     .pipe(takeUntil(this.unsubscribeNotifier)) |     .pipe(takeUntil(this.unsubscribeNotifier)) | ||||||
|     .subscribe(({updateResult, nextDocId, closeResult}) => { |     .subscribe(({updateResult, nextDocId, closeResult}) => { | ||||||
|  |       this.error = null | ||||||
|  |       this.networkActive = false | ||||||
|       if (closeResult) { |       if (closeResult) { | ||||||
|         this.router.navigate(['documents', nextDocId]) |         this.router.navigate(['documents', nextDocId]) | ||||||
|         this.titleInput?.focus() |         this.titleInput?.focus() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon