Fix ZIP file naming in download functionality for card creator
This commit is contained in:
parent
21005d311c
commit
98c36f913f
1 changed files with 2 additions and 1 deletions
|
@ -347,6 +347,7 @@ zipBtn.onclick = async () => {
|
||||||
const safePack = (packInput.value || "pack").replace(/[^a-z0-9_\-]/gi, "_");
|
const safePack = (packInput.value || "pack").replace(/[^a-z0-9_\-]/gi, "_");
|
||||||
const imgFileName = `kemoverse_${safePack}_${safeName}.webp`;
|
const imgFileName = `kemoverse_${safePack}_${safeName}.webp`;
|
||||||
const jsonFileName = `kemoverse_${safePack}_${safeName}.json`;
|
const jsonFileName = `kemoverse_${safePack}_${safeName}.json`;
|
||||||
|
const zipFileName = `kemoverse_${safePack}_${safeName}.zip`;
|
||||||
|
|
||||||
// Create ZIP
|
// Create ZIP
|
||||||
const zip = new JSZip();
|
const zip = new JSZip();
|
||||||
|
@ -360,7 +361,7 @@ zipBtn.onclick = async () => {
|
||||||
const content = await zip.generateAsync({type: "blob"});
|
const content = await zip.generateAsync({type: "blob"});
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
link.href = URL.createObjectURL(content);
|
link.href = URL.createObjectURL(content);
|
||||||
link.download = `kemoverse_${safePack}_${safeName}.zip`;
|
link.download = zipFileName;
|
||||||
link.click();
|
link.click();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue