Update Settings.mc

Test the phone is connected before attempting WebHook HTTP requests.
This commit is contained in:
Philip Abbey
2024-08-18 12:04:34 +01:00
parent 19642c6679
commit 42d1a7233c

View File

@ -70,6 +70,7 @@ class Settings {
// Manage this inside the application or widget only (not a glance or background service process)
if (mIsApp) {
if (mHasService) {
if (System.getDeviceSettings().phoneConnected) {
mWebhookManager = new WebhookManager();
if (getWebhookId().equals("")) {
// System.println("Settings update(): Doing full webhook & sensor creation.");
@ -107,6 +108,9 @@ class Settings {
unsetIsSensorsLevelEnabled();
unsetWebhookId();
}
} else {
ErrorView.show(WatchUi.loadResource($.Rez.Strings.NoPhone) as Lang.String);
}
}
// System.println("Settings update(): getTemporalEventRegisteredTime() = " + Background.getTemporalEventRegisteredTime());
// if (Background.getTemporalEventRegisteredTime() != null) {