diff --git a/components/ratelimitindicator.cpp b/components/ratelimitindicator.cpp index 52feed0..d962f98 100644 --- a/components/ratelimitindicator.cpp +++ b/components/ratelimitindicator.cpp @@ -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; diff --git a/windows/mainwindow.cpp b/windows/mainwindow.cpp index 6565e3b..863d437 100644 --- a/windows/mainwindow.cpp +++ b/windows/mainwindow.cpp @@ -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"); });