From 1a41addca3cf4e554ea339c053e77754eb63ec3d Mon Sep 17 00:00:00 2001 From: Nicolas Molina Monroy Date: Tue, 8 Oct 2024 16:58:44 -0400 Subject: [PATCH] fix(edit-content): Angular Observable Destruction Error (#30294) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Error ![Screenshot 2024-10-08 at 4 23 49 PM](https://github.com/user-attachments/assets/4b3f2014-762d-4234-b21c-843356f7af86) ### Proposed Changes * Remove the unnecessary `takeUntilDestroyed` because `this.#dialogRef.close();` [completes](https://github.com/primefaces/primeng/blob/d6c7ffcfc5cb9a8ed355399ddae276c279836ccf/src/app/components/dynamicdialog/dynamicdialog-ref.ts#L13) the observable. ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Ref https://github.com/primefaces/primeng/blob/d6c7ffcfc5cb9a8ed355399ddae276c279836ccf/src/app/components/dynamicdialog/dynamicdialog-ref.ts#L13 --- .../dot-edit-content-file-field.component.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts index 0ca97eecdff..9c7238297fa 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts @@ -8,7 +8,6 @@ import { OnInit, OnDestroy } from '@angular/core'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { ButtonModule } from 'primeng/button'; @@ -234,14 +233,9 @@ export class DotEditContentFileFieldComponent implements ControlValueAccessor, O } }); - this.#dialogRef.onClose - .pipe( - filter((file) => !!file), - takeUntilDestroyed() - ) - .subscribe((file) => { - this.store.setPreviewFile(file); - }); + this.#dialogRef.onClose.pipe(filter((file) => !!file)).subscribe((file) => { + this.store.setPreviewFile(file); + }); } /**