# HG changeset patch # User Nicholas Jillings # Date 1433174445 -3600 # Node ID a38623c8cfc9d43889706f10febe3c6335ec54c6 # Parent 1365362c12d5edada1ea6232a4ca59c9fbc7d4e4 Better error catching when using server save to determine if the 'Save File' should be shown in browser. diff -r 1365362c12d5 -r a38623c8cfc9 core.js --- a/core.js Mon Jun 01 12:56:15 2015 +0100 +++ b/core.js Mon Jun 01 17:00:45 2015 +0100 @@ -378,10 +378,13 @@ console.log('Error saving file to server! Presenting download locally'); createProjectSave(null); }; + xmlhttp.onreadystatechange = function() { + console.log(xmlhttp.status); + if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { + createProjectSave(null); + } + }; xmlhttp.send(file); - if (xmlhttp.status == 404) { - createProjectSave(null); - } } return submitDiv; }