From 713bedf3b388de1bda0fc5e331911ee24d097fff Mon Sep 17 00:00:00 2001 From: "Taylor Wilsdon (aider)" Date: Sun, 15 Dec 2024 18:46:32 -0500 Subject: [PATCH] fix: Simplify Google Drive Picker API loading to resolve 404 error --- src/lib/utils/google-drive-picker.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/lib/utils/google-drive-picker.ts b/src/lib/utils/google-drive-picker.ts index b76daaec0..e19b2dd8f 100644 --- a/src/lib/utils/google-drive-picker.ts +++ b/src/lib/utils/google-drive-picker.ts @@ -23,25 +23,17 @@ export const loadGoogleDriveApi = () => { const script = document.createElement('script'); script.src = 'https://apis.google.com/js/api.js'; script.onload = () => { - gapi.load('client:picker', { - callback: () => { - gapi.client.load('picker', 'v1').then(() => { - pickerApiLoaded = true; - resolve(true); - }); - } + gapi.load('picker', () => { + pickerApiLoaded = true; + resolve(true); }); }; script.onerror = reject; document.body.appendChild(script); } else { - gapi.load('client:picker', { - callback: () => { - gapi.client.load('picker', 'v1').then(() => { - pickerApiLoaded = true; - resolve(true); - }); - } + gapi.load('picker', () => { + pickerApiLoaded = true; + resolve(true); }); } });