Skip to content

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

Try to prevent title debounce overwriting

Michael Shamoonf78e93a3645e
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts
index f99f547e6..19f85398b 100644
--- a/src-ui/src/app/components/document-detail/document-detail.component.ts
+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts
@@ -204,6 +204,10 @@ export class DocumentDetailComponent
)
.subscribe({
next: (titleValue) => {
+ // In the rare case when the field changed just after debounced event was fired.
+ // We dont want to overwrite whats actually in the text field, so just return
+ if (titleValue !== this.titleInput.value) return
+
this.title = titleValue
this.documentForm.patchValue({ title: titleValue })
},