fix: theme exports and imports sometimes failing due to attached images

This commit is contained in:
SethBurkart123
2025-02-14 17:49:31 +11:00
parent a321a482cc
commit 8972a5a8bf
2 changed files with 24 additions and 6 deletions
+6 -1
View File
@@ -28,7 +28,12 @@ const shareTheme = async (themeID: string) => {
// Helper function to convert Blob to Base64
const blobToBase64 = (blob: Blob) => new Promise<string>((resolve, reject) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result as string);
reader.onloadend = () => {
const base64String = reader.result as string;
// Extract just the base64 data without the data URL prefix
const base64Data = base64String.split(',')[1];
resolve(base64Data);
};
reader.onerror = reject;
reader.readAsDataURL(blob);
});