Fix #133 Incorrect download contents

This commit is contained in:
Misode
2021-03-11 17:41:43 +01:00
parent 8a38558149
commit 4b9b59b3c7
+1 -1
View File
@@ -35,7 +35,7 @@ export const SourcePanel = (view: View, model: DataModel) => {
Tracker.copy()
}
const downloadSource = (el: Element) => {
const fileContents = encodeURIComponent(JSON.stringify(model.data, null, 2) + "\n")
const fileContents = encodeURIComponent(App.jsonOutput.get() + '\n')
const downloadAnchor = el.lastElementChild as HTMLAnchorElement
downloadAnchor.setAttribute('href', 'data:text/json;charset=utf-8,' + fileContents)
downloadAnchor.setAttribute("download", "data.json")