Skip to content

Commit 55581df

Browse files
authored
[ENG-9260] | fix google-file-picker issue (#825)
1 parent e5ddc7d commit 55581df

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/app/shared/components/google-file-picker/google-file-picker.component.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { TranslatePipe, TranslateService } from '@ngx-translate/core';
44

55
import { Button } from 'primeng/button';
66

7-
import { ChangeDetectionStrategy, Component, inject, input, OnInit, signal } from '@angular/core';
7+
import { ChangeDetectionStrategy, Component, effect, inject, input, OnInit, signal } from '@angular/core';
88

99
import { ENVIRONMENT } from '@core/provider/environment.provider';
1010
import { SENTRY_TOKEN } from '@core/provider/sentry.provider';
@@ -48,6 +48,18 @@ export class GoogleFilePickerComponent implements OnInit {
4848
return !!this.apiKey && !!this.appId;
4949
}
5050

51+
constructor() {
52+
effect(() => {
53+
const isReady = !this.isGFPDisabled();
54+
const hasRootFolder = !!this.rootFolder();
55+
const isFilePicker = !this.isFolderPicker();
56+
57+
if (isReady && hasRootFolder && isFilePicker) {
58+
this.createPicker();
59+
}
60+
});
61+
}
62+
5163
ngOnInit(): void {
5264
if (!this.isPickerConfigured) {
5365
this.isGFPDisabled.set(true);

0 commit comments

Comments
 (0)