From 5f7a5f55b43d13c73e4881e575e14d80cc81c248 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" <> Date: Sun, 19 Jan 2025 03:01:30 -0700 Subject: [PATCH] Handle multiple DynamicDialogRef --- .../components/library-creator/library-creator.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/booklore-ui/src/app/book/components/library-creator/library-creator.component.ts b/booklore-ui/src/app/book/components/library-creator/library-creator.component.ts index f32abb082..8d7cfddfb 100644 --- a/booklore-ui/src/app/book/components/library-creator/library-creator.component.ts +++ b/booklore-ui/src/app/book/components/library-creator/library-creator.component.ts @@ -31,6 +31,7 @@ export class LibraryCreatorComponent implements OnInit { mode!: string; library!: Library | undefined; editModeLibraryName: string = ''; + directoryPickerDialogRef!: DynamicDialogRef; private dialogService = inject(DialogService); private dynamicDialogRef = inject(DynamicDialogRef); @@ -54,7 +55,7 @@ export class LibraryCreatorComponent implements OnInit { } show() { - this.dynamicDialogRef = this.dialogService.open(DirectoryPickerComponent, { + this.directoryPickerDialogRef = this.dialogService.open(DirectoryPickerComponent, { header: 'Select Media Directory', modal: true, width: '50%', @@ -63,7 +64,7 @@ export class LibraryCreatorComponent implements OnInit { baseZIndex: 10 }); - this.dynamicDialogRef.onClose.subscribe((selectedFolder: string) => { + this.directoryPickerDialogRef.onClose.subscribe((selectedFolder: string) => { if (selectedFolder) { this.addFolder(selectedFolder); }