mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-29 14:16:38 +00:00
Merge pull request #34 from 3urobeat/fix/message-channel-create-refresh
fix: Fix message channel list not updating instantly Creating a channel didn't rebuild the Messages screen's cached channel list until you backed all the way out and reopened it. Tracks whether the Add/Edit channel form was active on the previous render and rebuilds the list once it closes.
This commit is contained in:
@@ -910,6 +910,7 @@ class MessagesScreen : public UIScreen {
|
|||||||
// delegated to while active(), the same relationship WaypointsView has with
|
// delegated to while active(), the same relationship WaypointsView has with
|
||||||
// TrailScreen.
|
// TrailScreen.
|
||||||
ChannelsView _ch_view;
|
ChannelsView _ch_view;
|
||||||
|
bool _ch_view_pending_rebuild = false; // tracks redraw after channel create/delete
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MessagesScreen(UITask* task, KeyboardWidget* kb)
|
MessagesScreen(UITask* task, KeyboardWidget* kb)
|
||||||
@@ -1145,6 +1146,7 @@ public:
|
|||||||
_unread_at_entry = 0;
|
_unread_at_entry = 0;
|
||||||
_viewing_max_seen = 0;
|
_viewing_max_seen = 0;
|
||||||
_ch_view.reset();
|
_ch_view.reset();
|
||||||
|
_ch_view_pending_rebuild = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recent DM contacts, newest first, deduped (forwarded to the history store).
|
// Recent DM contacts, newest first, deduped (forwarded to the history store).
|
||||||
@@ -1317,7 +1319,16 @@ public:
|
|||||||
display.setColor(DisplayDriver::LIGHT);
|
display.setColor(DisplayDriver::LIGHT);
|
||||||
|
|
||||||
// Channel Add/Edit form owns the screen while active.
|
// Channel Add/Edit form owns the screen while active.
|
||||||
if (_ch_view.active()) return _ch_view.render(display);
|
if (_ch_view.active()) {
|
||||||
|
_ch_view_pending_rebuild = true;
|
||||||
|
return _ch_view.render(display);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rebuild channel list if one is pending, due to for example a channel create/delete
|
||||||
|
if (_ch_view_pending_rebuild) {
|
||||||
|
_ch_view_pending_rebuild = false;
|
||||||
|
buildChannelList();
|
||||||
|
}
|
||||||
|
|
||||||
// Navigate-to-location view sits over everything else while active.
|
// Navigate-to-location view sits over everything else while active.
|
||||||
if (_nav_active) { renderNav(display); return 1000; }
|
if (_nav_active) { renderNav(display); return 1000; }
|
||||||
|
|||||||
Reference in New Issue
Block a user