@@ -10,6 +10,8 @@ import { InputText } from 'primeng/inputtext';
1010import { RadioButton } from 'primeng/radiobutton' ;
1111import { Skeleton } from 'primeng/skeleton' ;
1212
13+ import { timer } from 'rxjs' ;
14+
1315import {
1416 ChangeDetectionStrategy ,
1517 Component ,
@@ -22,6 +24,7 @@ import {
2224 OnInit ,
2325 output ,
2426 signal ,
27+ viewChild ,
2528} from '@angular/core' ;
2629import { takeUntilDestroyed , toSignal } from '@angular/core/rxjs-interop' ;
2730import { FormControl , FormsModule , ReactiveFormsModule } from '@angular/forms' ;
@@ -60,6 +63,8 @@ import { ResourceTypeInfoDialogComponent } from '../resource-type-info-dialog/re
6063 changeDetection : ChangeDetectionStrategy . OnPush ,
6164} )
6265export class StorageItemSelectorComponent implements OnInit {
66+ addFilesPicker = viewChild < GoogleFilePickerComponent > ( 'filePicker' ) ;
67+
6368 private destroyRef = inject ( DestroyRef ) ;
6469 private customDialogService = inject ( CustomDialogService ) ;
6570 private translateService = inject ( TranslateService ) ;
@@ -236,6 +241,11 @@ export class StorageItemSelectorComponent implements OnInit {
236241 handleFolderSelection = ( folder : StorageItem ) : void => {
237242 this . selectedStorageItem . set ( folder ) ;
238243 this . hasFolderChanged . set ( folder ?. itemId !== this . initiallySelectedStorageItem ( ) ?. itemId ) ;
244+ if ( this . isGoogleFilePicker ( ) ) {
245+ timer ( 1000 )
246+ . pipe ( takeUntilDestroyed ( this . destroyRef ) )
247+ . subscribe ( ( ) => this . addFilesPicker ( ) ?. createPicker ( ) ) ;
248+ }
239249 } ;
240250
241251 private updateBreadcrumbs (
0 commit comments