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": ()=>{ "Force refresh": ()=>{
E.showMessage("Reloading weather"); if (!Bangle.pullOwmWeather){
Bangle.pullOwmWeather(true, (e)=>{ E.showAlert("Reload watch after enabling","Hint").then(()=>{
if (e) { E.showMenu(buildMainMenu());
E.showAlert(e,"Error").then(()=>{ });
E.showMenu(buildMainMenu()); } else {
}); E.showMessage("Reloading weather");
} else { Bangle.pullOwmWeather(true, (e)=>{
E.showAlert("Success").then(()=>{ if (e) {
E.showMenu(buildMainMenu()); E.showAlert(e,"Error").then(()=>{
}); E.showMenu(buildMainMenu());
} });
}); } else {
E.showAlert("Success").then(()=>{
E.showMenu(buildMainMenu());
});
}
});
}
} }
}; };