mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(workspace): fix svg display on browser (#5158)
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
import { fetcher } from '@affine/workspace/affine/gql';
|
||||
|
||||
import type { BlobStorage } from '../engine';
|
||||
import { bufferToBlob } from '../util';
|
||||
|
||||
export const createAffineCloudBlobStorage = (
|
||||
workspaceId: string
|
||||
@@ -26,7 +27,7 @@ export const createAffineCloudBlobStorage = (
|
||||
// status not in the range 200-299
|
||||
return undefined;
|
||||
}
|
||||
return await res.blob();
|
||||
return bufferToBlob(await res.arrayBuffer());
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createStore, del, get, keys, set } from 'idb-keyval';
|
||||
|
||||
import type { BlobStorage } from '../engine';
|
||||
import { bufferToBlob } from '../util';
|
||||
|
||||
export const createIndexeddbBlobStorage = (
|
||||
workspaceId: string
|
||||
@@ -13,7 +14,7 @@ export const createIndexeddbBlobStorage = (
|
||||
get: async (key: string) => {
|
||||
const res = await get<ArrayBuffer>(key, db);
|
||||
if (res) {
|
||||
return new Blob([res], { type: await get(key, mimeTypeDb) });
|
||||
return bufferToBlob(res);
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user