From 97cfd918da315e6f0b210507abd41921cc17fb98 Mon Sep 17 00:00:00 2001 From: Misode Date: Sun, 17 Oct 2021 15:44:41 +0200 Subject: [PATCH] Fix #180 download full output JSON --- src/app/components/generator/SourcePanel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/generator/SourcePanel.tsx b/src/app/components/generator/SourcePanel.tsx index 12dbfe0c..d6eb59e1 100644 --- a/src/app/components/generator/SourcePanel.tsx +++ b/src/app/components/generator/SourcePanel.tsx @@ -87,8 +87,8 @@ export function SourcePanel({ lang, name, model, blockStates, doCopy, doDownload }, [doCopy]) useEffect(() => { - if (doDownload && source.current && download.current) { - const content = encodeURIComponent(source.current.value) + if (doDownload && model && blockStates && download.current) { + const content = encodeURIComponent(getOutput(model, blockStates)) download.current.setAttribute('href', `data:text/json;charset=utf-8,${content}`) download.current.setAttribute('download', `${name}.json`) download.current.click()