Fix: intermittent save & close warnings in v2.5.3 (#5838)

This commit is contained in:
shamoon 2024-02-25 16:59:29 -08:00 committed by GitHub
parent 76064178f5
commit 4948438378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -634,11 +634,14 @@ export class DocumentDetailComponent
// in case data changed while saving eg removing inbox_tags // in case data changed while saving eg removing inbox_tags
this.documentForm.patchValue(docValues) this.documentForm.patchValue(docValues)
this.store.next(this.documentForm.value) this.store.next(this.documentForm.value)
this.openDocumentService.setDirty(this.document, false)
this.toastService.showInfo($localize`Document saved successfully.`) this.toastService.showInfo($localize`Document saved successfully.`)
close && this.close()
this.networkActive = false this.networkActive = false
this.error = null this.error = null
this.openDocumentService.refreshDocument(this.documentId) close &&
this.close(() =>
this.openDocumentService.refreshDocument(this.documentId)
)
}, },
error: (error) => { error: (error) => {
this.networkActive = false this.networkActive = false
@ -693,12 +696,13 @@ export class DocumentDetailComponent
}) })
} }
close() { close(closedCallback: () => void = null) {
this.openDocumentService this.openDocumentService
.closeDocument(this.document) .closeDocument(this.document)
.pipe(first()) .pipe(first())
.subscribe((closed) => { .subscribe((closed) => {
if (!closed) return if (!closed) return
if (closedCallback) closedCallback()
if (this.documentListViewService.activeSavedViewId) { if (this.documentListViewService.activeSavedViewId) {
this.router.navigate([ this.router.navigate([
'view', 'view',