diff --git a/Projects/Superalgos/UI/Spaces/Design-Space/Workspace.js b/Projects/Superalgos/UI/Spaces/Design-Space/Workspace.js index c2cab9ccd..d339600d0 100644 --- a/Projects/Superalgos/UI/Spaces/Design-Space/Workspace.js +++ b/Projects/Superalgos/UI/Spaces/Design-Space/Workspace.js @@ -172,6 +172,10 @@ function newWorkspace() { } let url = 'SaveWorkspace/' + workspace.name + if (textToSave === '{"type":"Workspace","name":"Getting Started","rootNodes":[null,null,null,null,null,null,null,null,null]}') { + console.log('[WARN] The system tried to save an empty workspace. Saving cancelled.') + return + } httpRequest(textToSave, url, onResponse) return true diff --git a/TaskServer/CloudUtilities.js b/TaskServer/CloudUtilities.js index 1c376ccce..585200e5a 100644 --- a/TaskServer/CloudUtilities.js +++ b/TaskServer/CloudUtilities.js @@ -4,21 +4,11 @@ exports.newCloudUtilities = function newCloudUtilities() { const MODULE_NAME = "Cloud Utilities"; let utilities = { - pad: pad, - calculatePresicion: calculatePresicion + pad: pad }; return utilities; - function calculatePresicion(number) { - - for (let i = -10; i <= 10; i++) { - if (number < Math.pow(10, i)) { - return Math.pow(10, i - 3); - } - } - } - function pad(str, max) { str = str.toString(); return str.length < max ? pad("0" + str, max) : str;