mirror of
https://github.com/open-webui/open-webui
synced 2025-04-05 05:10:46 +00:00
fix: Simplify Google Drive Picker API loading to resolve 404 error
This commit is contained in:
parent
aaacd28131
commit
713bedf3b3
@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user