mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-12-16 11:08:15 +00:00
Add error handling for empty menu data
New string resource for menu definition errors and updates HomeAssistantApp to show an error message when the menu data is empty.
This commit is contained in:
@@ -218,6 +218,8 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
} else {
|
||||
if (data == null) {
|
||||
ErrorView.show(WatchUi.loadResource($.Rez.Strings.NoJson) as Lang.String);
|
||||
} else if (data.size() == 0) {
|
||||
ErrorView.show(WatchUi.loadResource($.Rez.Strings.NoMenu) as Lang.String);
|
||||
} else {
|
||||
buildMenu(data);
|
||||
WatchUi.switchToView(mHaMenu, new HomeAssistantViewDelegate(false), WatchUi.SLIDE_IMMEDIATE);
|
||||
|
||||
Reference in New Issue
Block a user