mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 09:21:24 +08:00
fix(workspace): cloud workspace blob uploading
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user