owmweather - Show hint if pull method not available

master
Martin Boonk 2022-07-02 22:49:09 +02:00
parent d26c33aef6
commit b6c6ca3c86
1 changed files with 18 additions and 12 deletions

View File

@ -38,18 +38,24 @@
}
},
"Force refresh": ()=>{
E.showMessage("Reloading weather");
Bangle.pullOwmWeather(true, (e)=>{
if (e) {
E.showAlert(e,"Error").then(()=>{
E.showMenu(buildMainMenu());
});
} else {
E.showAlert("Success").then(()=>{
E.showMenu(buildMainMenu());
});
}
});
if (!Bangle.pullOwmWeather){
E.showAlert("Reload watch after enabling","Hint").then(()=>{
E.showMenu(buildMainMenu());
});
} else {
E.showMessage("Reloading weather");
Bangle.pullOwmWeather(true, (e)=>{
if (e) {
E.showAlert(e,"Error").then(()=>{
E.showMenu(buildMainMenu());
});
} else {
E.showAlert("Success").then(()=>{
E.showMenu(buildMainMenu());
});
}
});
}
}
};