mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 03:35:07 +08:00
save blob to indexeddb instead of base64 image string
This commit is contained in:
@@ -3,7 +3,7 @@ import { showToast } from "@/app/components/ui-lib";
|
||||
import { getHeaders } from "@/app/client/api";
|
||||
import { createPersistStore } from "@/app/utils/store";
|
||||
import { nanoid } from "nanoid";
|
||||
import { saveFileData } from "@/app/utils/file";
|
||||
import { saveFileData, base64Image2Blob } from "@/app/utils/file";
|
||||
|
||||
export const useSdStore = createPersistStore<
|
||||
{
|
||||
@@ -72,7 +72,12 @@ export const useSdStore = createPersistStore<
|
||||
this.updateDraw({
|
||||
...data,
|
||||
status: "success",
|
||||
img_data: saveFileData(db, data.id, resData.image),
|
||||
// save blob to indexeddb instead of base64 image string
|
||||
img_data: saveFileData(
|
||||
db,
|
||||
data.id,
|
||||
base64Image2Blob(resData.image, "image/png"),
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.updateDraw({
|
||||
|
Reference in New Issue
Block a user