mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
fix(SaveTheme): images not saving properly
This commit is contained in:
@@ -6,7 +6,7 @@ const saveThemeFile = (data: object, fileName: string) => {
|
|||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = `${fileName}.json`;
|
a.download = `${fileName}.json.theme`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
@@ -34,13 +34,14 @@ const shareTheme = async (themeID: string) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Convert cover image to Base64
|
// Convert cover image to Base64
|
||||||
const coverImageBlob = await fetch(coverImage as string).then(res => res.blob());
|
let coverImageBase64 = null;
|
||||||
const coverImageBase64 = await blobToBase64(coverImageBlob);
|
if (coverImage) {
|
||||||
|
coverImageBase64 = await blobToBase64(coverImage);
|
||||||
|
}
|
||||||
|
|
||||||
// Convert custom images to Base64
|
// Convert custom images to Base64
|
||||||
const finalImages = await Promise.all(CustomImages.map(async (image) => {
|
const finalImages = await Promise.all(CustomImages.map(async (image) => {
|
||||||
const imageBlob = await fetch(image.url as string).then(res => res.blob());
|
const imageBase64 = await blobToBase64(image.blob);
|
||||||
const imageBase64 = await blobToBase64(imageBlob);
|
|
||||||
return {
|
return {
|
||||||
id: image.id,
|
id: image.id,
|
||||||
variableName: image.variableName,
|
variableName: image.variableName,
|
||||||
|
|||||||
Reference in New Issue
Block a user