mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-25 08:06:51 +00:00
Download pack.mcmeta with correct file name
This commit is contained in:
@@ -169,7 +169,8 @@ export function SourcePanel({ name, model, blockStates, doCopy, doDownload, doIm
|
||||
if (doDownload && model && blockStates && download.current) {
|
||||
const content = encodeURIComponent(getSerializedOutput(model, blockStates))
|
||||
download.current.setAttribute('href', `data:text/json;charset=utf-8,${content}`)
|
||||
download.current.setAttribute('download', `${name}.${format}`)
|
||||
const fileName = name === 'pack_mcmeta' ? 'pack.mcmeta' : `${name}.${format}`
|
||||
download.current.setAttribute('download', fileName)
|
||||
download.current.click()
|
||||
}
|
||||
}, [doDownload])
|
||||
|
||||
Reference in New Issue
Block a user