Skip to content

Commit e7d5f8c

Browse files
authored
fix: Add console warning for missing app-id attribute (#96)
* fix: Add console warning for missing `app-id` attribute in drive picker * fix: simplify appId existence check
1 parent cd529d4 commit e7d5f8c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/kind-bugs-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@googleworkspace/drive-picker-element": patch
3+
---
4+
5+
Add a console warning when the `app-id` attribute is missing. While the picker may function without it, `app-id` is often required for backend API integration (e.g., `drive.files.get`). This warning helps developers identify potential configuration issues earlier.

packages/drive-picker-element/src/drive-picker/drive-picker-element.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,13 @@ export class DrivePickerElement extends HTMLElement {
213213
);
214214

215215
const appId = this.getAttribute("app-id");
216-
if (appId !== null) builder = builder.setAppId(appId);
216+
if (appId) {
217+
builder = builder.setAppId(appId);
218+
} else {
219+
console.warn(
220+
"drive-picker: app-id attribute is missing. This may cause issues with backend API integration.",
221+
);
222+
}
217223

218224
const developerKey = this.getAttribute("developer-key");
219225
if (developerKey !== null) builder = builder.setDeveloperKey(developerKey);

0 commit comments

Comments
 (0)