Skip to content

Commit

Permalink
Fix promise resolving value
Browse files Browse the repository at this point in the history
  • Loading branch information
Amphiluke committed Sep 25, 2021
1 parent ef4913b commit 904af3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions www/save-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
}
return new Promise((resolve, reject) => {
exec(resolve, reject, "SaveDialog", "locateFile", [blob.type || "application/octet-stream", name]);
}).then(uri => {
}).then(uri => new Promise((resolve, reject) => {
let reader = new FileReader();
reader.onload = () => {
exec(resolve, reject, "SaveDialog", "saveFile", [uri, reader.result]);
Expand All @@ -21,6 +21,6 @@ module.exports = {
reject("Blob reading has been aborted");
};
reader.readAsArrayBuffer(blob);
});
}));
}
};

0 comments on commit 904af3b

Please sign in to comment.