Compare commits

..

No commits in common. "db3940f3545c40c8c9b8954a839d71b7eb4162aa" and "b63cdc2c5cfff921cc6ba51b5fd7f9b343018f39" have entirely different histories.

2 changed files with 48 additions and 42 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "12.110.1+birb3-1", "version": "12.110.1+birb3",
"codename": "indigo", "codename": "indigo",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -554,6 +554,8 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const id = Math.random().toString(); const id = Math.random().toString();
const reader = new FileReader();
reader.onload = (e) => {
const ctx = reactive({ const ctx = reactive({
id: id, id: id,
name: name || file.name || 'untitled', name: name || file.name || 'untitled',
@ -564,6 +566,8 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
uploads.value.push(ctx); uploads.value.push(ctx);
console.log(keepOriginal);
const data = new FormData(); const data = new FormData();
data.append('i', $i.token); data.append('i', $i.token);
data.append('force', 'true'); data.append('force', 'true');
@ -603,6 +607,8 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
}; };
xhr.send(data); xhr.send(data);
};
reader.readAsArrayBuffer(file);
}); });
} }