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:
Jakub
2026-09-09 14:19:32 +02:00
@@ -910,6 +910,7 @@ class MessagesScreen : public UIScreen {
// delegated to while active(), the same relationship WaypointsView has with
// TrailScreen.
ChannelsView _ch_view;
bool _ch_view_pending_rebuild = false; // tracks redraw after channel create/delete
public:
MessagesScreen(UITask* task, KeyboardWidget* kb)
@@ -1145,6 +1146,7 @@ public:
_unread_at_entry = 0;
_viewing_max_seen = 0;
_ch_view.reset();
_ch_view_pending_rebuild = false;
}
// Recent DM contacts, newest first, deduped (forwarded to the history store).
@@ -1317,7 +1319,16 @@ public:
display.setColor(DisplayDriver::LIGHT);
// 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.
if (_nav_active) { renderNav(display); return 1000; }