Skip to content

Commit

Permalink
Changed GWT game import code to use addEventListener rather than onlo…
Browse files Browse the repository at this point in the history
…adend for FileReader.
  • Loading branch information
lanceewing committed Apr 7, 2024
1 parent 942cd84 commit 5eea774
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ private final native void showHtmlOpenFileDialog(String type, GwtOpenFileResults
var reader = new FileReader();
// NOTE 1: loadend called regards of whether it was successful or not.
// NOTE 2: file has .name, .size and .lastModified fields.
reader.onloadend = function (event) {
reader.addEventListener("loadend", function (event) {
console.log('Finished reading in file ' + file.name);
resolve({
fileName: file.name,
filePath: file.webkitRelativePath? file.webkitRelativePath : '',
fileData: reader.result
});
};
});
reader.readAsArrayBuffer(file);
});
})).then(function (results) {
Expand Down

0 comments on commit 5eea774

Please sign in to comment.