Skip to content

Commit

Permalink
Reject early in case of unsupported platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Amphiluke committed Sep 25, 2021
1 parent 680e3fb commit ef4913b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions www/save-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ let FileReader = moduleMapper.getOriginalSymbol(window, "FileReader") || window.

module.exports = {
saveFile(blob, name = "") {
if (window.cordova.platformId !== "android") {
return Promise.reject("Unsupported platform");
}
return new Promise((resolve, reject) => {
exec(resolve, reject, "SaveDialog", "locateFile", [blob.type || "application/octet-stream", name]);
}).then(uri => {
Expand Down

0 comments on commit ef4913b

Please sign in to comment.