Skip to content

Commit

Permalink
Fix menu not opening after a refresh without internet connection
Browse files Browse the repository at this point in the history
Refs: #53
  • Loading branch information
orontee committed Oct 1, 2023
1 parent c4bd909 commit b8072d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Changed

- Fix menu not opening after a refresh without internet connection
[#53](https://github.com/orontee/taranis/issues/53)

- Don't open menu during data refresh
[#51](https://github.com/orontee/taranis/issues/51)

Expand Down
10 changes: 5 additions & 5 deletions src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class App {

ClearTimerByName(App::refresh_timer_name);

this->model->refresh_date = 0;
clear_model_weather_conditions();

const auto units = Units{this->model}.to_string();
try {
Expand All @@ -299,10 +299,6 @@ class App {
}

this->model->alerts = this->service->get_alerts();

const auto event_handler = GetEventHandler();
SendEvent(event_handler, EVT_CUSTOM, CustomEvent::model_updated, 0);

} catch (const ConnectionError &error) {
Message(
ICON_WARNING, GetLangText("Network error"),
Expand All @@ -321,6 +317,10 @@ class App {
}
SetHardTimer(App::refresh_timer_name, &taranis::App::refresh_data_maybe,
App::refresh_period);

const auto event_handler = GetEventHandler();
SendEvent(event_handler, EVT_CUSTOM, CustomEvent::model_updated, 0);

HideHourglass();
}

Expand Down

0 comments on commit b8072d8

Please sign in to comment.