set main window to invalid channel when looking at friends

This commit is contained in:
ouwou 2021-05-14 23:43:37 -04:00
parent a283ab14a2
commit 6a15f91a14
2 changed files with 5 additions and 3 deletions

View File

@ -31,9 +31,9 @@ RateLimitIndicator::RateLimitIndicator()
void RateLimitIndicator::SetActiveChannel(Snowflake id) {
m_active_channel = id;
const auto channel = *Abaddon::Get().GetDiscordClient().GetChannel(m_active_channel);
if (channel.RateLimitPerUser.has_value())
m_rate_limit = *channel.RateLimitPerUser;
const auto channel = Abaddon::Get().GetDiscordClient().GetChannel(m_active_channel);
if (channel.has_value() && channel->RateLimitPerUser.has_value())
m_rate_limit = *channel->RateLimitPerUser;
else
m_rate_limit = 0;

View File

@ -87,6 +87,8 @@ MainWindow::MainWindow()
});
m_menu_view_friends.signal_activate().connect([this] {
UpdateChatActiveChannel(Snowflake::Invalid);
m_members.UpdateMemberList();
m_content_stack.set_visible_child("friends");
});