fix(workspace): cloud workspace blob uploading

This commit is contained in:
himself65
2023-04-21 11:34:06 -05:00
parent 7094385d8b
commit 023cbc30ea
+2 -1
View File
@@ -55,13 +55,14 @@ export const createAffineBlobStorage = (
}, },
set: async (key, value) => { set: async (key, value) => {
const db = await dbPromise; const db = await dbPromise;
const arrayBuffer = await value.arrayBuffer();
const t = db const t = db
.transaction('uploading', 'readwrite') .transaction('uploading', 'readwrite')
.objectStore('uploading'); .objectStore('uploading');
let uploaded = false; let uploaded = false;
t.put({ t.put({
key, key,
arrayBuffer: await value.arrayBuffer(), arrayBuffer,
type: value.type, type: value.type,
}).then(() => { }).then(() => {
// delete the uploading blob after uploaded // delete the uploading blob after uploaded