Skip to content

Commit 45054bc

Browse files
committed
Fix loading of icons with wrong MIME type
1 parent 4b87876 commit 45054bc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/stores/icon.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export const useIconStore = defineStore('icon', () => {
6060
return;
6161
}
6262

63-
const data = URL.createObjectURL(await res.blob());
63+
// Some SVGs have wrong MIME type, so we use Blob to force it.
64+
const bytes = await res.arrayBuffer();
65+
const blob = new Blob([bytes], { type: 'image/svg+xml' });
66+
67+
const data = URL.createObjectURL(blob);
6468
fetched(name, data);
6569

6670
const img = await loadImage(data);

0 commit comments

Comments
 (0)