]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Try to prevent title debounce overwriting 2543/head
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Wed, 25 Jan 2023 18:53:08 +0000 (10:53 -0800)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Wed, 25 Jan 2023 18:53:08 +0000 (10:53 -0800)
src-ui/src/app/components/document-detail/document-detail.component.ts

index f99f547e6a53469de8456655273103ed83a06de4..19f85398b00fa116256adce56e9832cda1e448c7 100644 (file)
@@ -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 })
               },