fix: Improve Google Drive picker initialization and error handling

This commit is contained in:
Taylor Wilsdon (aider)
2024-12-15 16:36:45 -05:00
parent eed7cfd2a2
commit 85508106a8
2 changed files with 13 additions and 4 deletions

View File

@@ -498,11 +498,15 @@
}}
uploadGoogleDriveHandler={async () => {
try {
if (!import.meta.env.VITE_GOOGLE_API_KEY || !import.meta.env.VITE_GOOGLE_CLIENT_ID) {
throw new Error('Google Drive API credentials not configured');
}
const fileData = await createPicker();
if (fileData) {
dispatch('upload', { type: 'google-drive', data: fileData });
}
} catch (error) {
console.error('Google Drive Error:', error);
toast.error('Error accessing Google Drive: ' + error.message);
}
}}