mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
feat: onedrive file picker integration
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { createPicker, getAuthToken } from '$lib/utils/google-drive-picker';
|
||||
import { openOneDrivePicker } from '$lib/utils/onedrive-file-picker';
|
||||
import { pickAndDownloadFile } from '$lib/utils/onedrive-file-picker';
|
||||
|
||||
import { onMount, tick, getContext, createEventDispatcher, onDestroy } from 'svelte';
|
||||
const dispatch = createEventDispatcher();
|
||||
@@ -1111,10 +1111,10 @@
|
||||
}}
|
||||
uploadOneDriveHandler={async () => {
|
||||
try {
|
||||
const fileData = await openOneDrivePicker();
|
||||
const fileData = await pickAndDownloadFile();
|
||||
if (fileData) {
|
||||
const file = new File([fileData.blob], fileData.name, {
|
||||
type: fileData.blob.type
|
||||
type: fileData.blob.type || 'application/octet-stream'
|
||||
});
|
||||
await uploadFileHandler(file);
|
||||
} else {
|
||||
@@ -1122,11 +1122,6 @@
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('OneDrive Error:', error);
|
||||
toast.error(
|
||||
$i18n.t('Error accessing OneDrive: {{error}}', {
|
||||
error: error.message
|
||||
})
|
||||
);
|
||||
}
|
||||
}}
|
||||
onClose={async () => {
|
||||
|
||||
Reference in New Issue
Block a user