Skip to content

Commit

Permalink
final fixes to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dip000 committed Feb 20, 2022
1 parent 01afdb6 commit 0dc2819
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 11 additions & 6 deletions MapBuilderForWeb/MapBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,17 @@ function Point(x, y){
/////////////////////////// UPLOAD /////////////////////////////////////////////////

function upload(uploadString){
let mapsAndShapesString = uploadString.split("$");
let mapsString = mapsAndShapesString[0].split("&");
let shapesString = mapsAndShapesString[1].split("&");

uploadShapes(shapesString);
uploadMaps(mapsString);
let mapsAndShapesString, mapsString, shapesString;
try{
mapsAndShapesString = uploadString.split("$");
mapsString = mapsAndShapesString[0].split("&");
shapesString = mapsAndShapesString[1].split("&");
} catch{ alert("Couldn't parse. File corrupted"); return; }

try{ uploadShapes(shapesString);} catch{ alert("Shapes couldn't be loaded"); return;}

try{ uploadMaps(mapsString);} catch{ alert("Maps couldn't be loaded"); return;}

ChangeItem(0);
}

Expand Down
4 changes: 3 additions & 1 deletion MapBuilderForWeb/MultimapMechanics.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@
document.querySelector('input[type=file]').value = "";
}

try{ reader.readAsText( file ); } catch{}
if(file){
try{ reader.readAsText( file ); } catch{ alert("This file Cannot be uploaded"); }
}
}

function downloadManager(){
Expand Down

0 comments on commit 0dc2819

Please sign in to comment.