diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index c50e8e0c7b..beff2e6a29 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -754,7 +754,8 @@ void TopBar::setupActions(not_null controller) { buttons.push_back(message); _actions->add(message); } - if (!topic && channel && !channel->amIn()) { + const auto canJoin = (!topic && channel && !channel->amIn()); + if (canJoin) { const auto join = Ui::CreateChild( this, tr::lng_profile_action_short_join(tr::now), @@ -942,6 +943,7 @@ void TopBar::setupActions(not_null controller) { return; } if (!topic + && canJoin && ((chat && !chat->amCreator() && !chat->hasAdminRights()) || (channel && !channel->amCreator()