From deb9aa435b18107bab7275628783ba9b270e6e5e Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 30 Jun 2024 15:13:54 +0300 Subject: [PATCH] Improved first display of personal channel in user profiles. --- .../info/profile/info_profile_actions.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index f7e37ced57..6e17ed5491 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -1240,9 +1240,6 @@ object_ptr DetailsFiller::setupPersonalChannel( ) | rpl::map(rpl::mappers::_1 != nullptr)); result->finishAnimating(); - auto channelToggleValue = PersonalChannelValue( - user - ) | rpl::map([=] { return !!user->personalChannelId(); }); auto channel = PersonalChannelValue( user ) | rpl::start_spawning(result->lifetime()); @@ -1270,8 +1267,10 @@ object_ptr DetailsFiller::setupPersonalChannel( object_ptr>( container, object_ptr(container))); - onlyChannelWrap->toggleOn(rpl::duplicate(channelToggleValue) - | rpl::map(!rpl::mappers::_1)); + onlyChannelWrap->toggleOn(PersonalChannelValue(user) | rpl::map([=] { + return user->personalChannelId() + && !user->personalChannelMessageId(); + })); onlyChannelWrap->finishAnimating(); Ui::AddDivider(onlyChannelWrap->entity()); @@ -1312,7 +1311,12 @@ object_ptr DetailsFiller::setupPersonalChannel( object_ptr>( container, object_ptr(container))); - messageChannelWrap->toggleOn(rpl::duplicate(channelToggleValue)); + messageChannelWrap->toggleOn(PersonalChannelValue( + user + ) | rpl::map([=] { + return user->personalChannelId() + && user->personalChannelMessageId(); + })); messageChannelWrap->finishAnimating(); const auto clear = [=] {