fix(workspace): cloud workspace blob uploading

This commit is contained in:
himself65 2023-04-21 11:34:06 -05:00
parent 7094385d8b
commit 023cbc30ea
No known key found for this signature in database
GPG Key ID: 35F07049B7A1E625

View File

@ -55,13 +55,14 @@ export const createAffineBlobStorage = (
},
set: async (key, value) => {
const db = await dbPromise;
const arrayBuffer = await value.arrayBuffer();
const t = db
.transaction('uploading', 'readwrite')
.objectStore('uploading');
let uploaded = false;
t.put({
key,
arrayBuffer: await value.arrayBuffer(),
arrayBuffer,
type: value.type,
}).then(() => {
// delete the uploading blob after uploaded