diff --git a/src/main/java/net/lax1dude/eaglercraft/GuiNameWorldImport.java b/src/main/java/net/lax1dude/eaglercraft/GuiNameWorldImport.java index e2d18da..67b5429 100644 --- a/src/main/java/net/lax1dude/eaglercraft/GuiNameWorldImport.java +++ b/src/main/java/net/lax1dude/eaglercraft/GuiNameWorldImport.java @@ -70,6 +70,7 @@ public class GuiNameWorldImport extends GuiScreen { protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.enabled) { if (par1GuiButton.id == 1) { + EaglerAdapter.clearFileChooserResult(); this.mc.displayGuiScreen(this.parentGuiScreen); } else if (par1GuiButton.id == 0) { this.buttonList.clear(); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java index 3d9cec1..41943bd 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java @@ -1908,6 +1908,10 @@ public class EaglerAdapterImpl2 { } return ret; } + + public static final void clearFileChooserResult() { + getFileChooserResult0(); + } @JSBody(params = { }, script = "var ret = window.eagsFileChooser.getFileChooserResult; window.eagsFileChooser.getFileChooserResult = null; return ret;") private static native ArrayBuffer getFileChooserResult0();