From 5ce5e5ac1e66fcdd24eae1e3b87b49d63e934076 Mon Sep 17 00:00:00 2001 From: Mike Lewis Date: Sun, 19 Jan 2020 21:15:40 +0000 Subject: [PATCH] Adjust type of data URI when saving (#452) Previously the type used for the data URI when saving was text/plain. On iPad, this caused the file to automatically have a .txt extension added (so files ended up with names like "drawing-xyz.json.txt"). This meant that the files couldn't be loaded by the tool, which expects only files with a .json extension. Now, the type used is application/json, which means that the files get saved with the correct extension and can be successfully loaded on iPad. --- src/scene/data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scene/data.ts b/src/scene/data.ts index f34ba50393..fe1602c419 100644 --- a/src/scene/data.ts +++ b/src/scene/data.ts @@ -96,7 +96,7 @@ export async function saveAsJSON( } else { saveFile( name, - "data:text/plain;charset=utf-8," + encodeURIComponent(serialized) + "data:application/json;charset=utf-8," + encodeURIComponent(serialized) ); } }