Skip to content

Commit

Permalink
Fixed 'permission denied' open error on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed May 21, 2018
1 parent 433cb99 commit d70dd05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/src/io/anuke/mindustry/IOSLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ public boolean didFinishLaunching(UIApplication application, UIApplicationLaunch
}

void openURL(NSURL url){
String str = url.getPath().toLowerCase();
FileHandle file = Gdx.files.absolute(getDocumentsDirectory()).child(url.getLastPathComponent());
Gdx.files.absolute(url.getPath()).copyTo(file);

Timers.runTask(30f, () -> {
FileHandle file = Gdx.files.absolute(url.getPath());

if(str.endsWith("mins")){ //open save
if(file.extension().equalsIgnoreCase("mins")){ //open save

if(SaveIO.isSaveValid(file)){
try{
Expand All @@ -134,7 +134,7 @@ void openURL(NSURL url){
ui.showError("$text.save.import.invalid");
}

}else if(str.endsWith("png")){ //open map
}else if(file.extension().equalsIgnoreCase("png")){ //open map
if(!ui.editor.isShown()){
ui.editor.show();
}
Expand Down

0 comments on commit d70dd05

Please sign in to comment.