From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 25 Jan 2023 18:53:08 +0000 (-0800) Subject: Try to prevent title debounce overwriting X-Git-Tag: v1.12.2~1^2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2543%2Fhead;p=thirdparty%2Fpaperless-ngx.git Try to prevent title debounce overwriting --- 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 f99f547e6a..19f85398b0 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 }) },