Cancel some http calls on doc change

This commit is contained in:
shamoon 2024-01-13 00:11:57 -08:00
parent 0ea965fdf4
commit d157eeae6a

View File

@ -421,7 +421,11 @@ export class DocumentDetailComponent
this.updateFormForCustomFields() this.updateFormForCustomFields()
this.documentsService this.documentsService
.getMetadata(doc.id) .getMetadata(doc.id)
.pipe(first()) .pipe(
first(),
takeUntil(this.unsubscribeNotifier),
takeUntil(this.docChangeNotifier)
)
.subscribe({ .subscribe({
next: (result) => { next: (result) => {
this.metadata = result this.metadata = result
@ -442,7 +446,11 @@ export class DocumentDetailComponent
) { ) {
this.documentsService this.documentsService
.getSuggestions(doc.id) .getSuggestions(doc.id)
.pipe(first(), takeUntil(this.unsubscribeNotifier)) .pipe(
first(),
takeUntil(this.unsubscribeNotifier),
takeUntil(this.docChangeNotifier)
)
.subscribe({ .subscribe({
next: (result) => { next: (result) => {
this.suggestions = result this.suggestions = result