mirror of https://github.com/espruino/BangleApps
On Android, try and use saveFile for backups
parent
431100f724
commit
144bf5a28a
|
@ -53,7 +53,12 @@ function bangleDownload() {
|
|||
}).then(content => {
|
||||
Progress.hide({ sticky: true });
|
||||
showToast('Backup complete!', 'success');
|
||||
Espruino.Core.Utils.fileSaveDialog(content, "Banglejs backup.zip");
|
||||
if (typeof Android !== "undefined" && typeof Android.saveFile === 'function') {
|
||||
// Recent Gadgetbridge version that provides the saveFile interface
|
||||
Android.saveFile("Banglejs backup.zip", "application/zip", content);
|
||||
} else {
|
||||
Espruino.Core.Utils.fileSaveDialog(content, "Banglejs backup.zip");
|
||||
}
|
||||
}).catch(err => {
|
||||
Progress.hide({ sticky: true });
|
||||
showToast('Backup failed, ' + err, 'error');
|
||||
|
|
Loading…
Reference in New Issue