Improved first display of personal channel in user profiles.

This commit is contained in:
23rd 2024-06-30 15:13:54 +03:00 committed by John Preston
parent 68cb568898
commit deb9aa435b

View File

@ -1240,9 +1240,6 @@ object_ptr<Ui::RpWidget> 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<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
container,
object_ptr<Ui::VerticalLayout>(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<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
container,
object_ptr<Ui::VerticalLayout>(container)));
messageChannelWrap->toggleOn(rpl::duplicate(channelToggleValue));
messageChannelWrap->toggleOn(PersonalChannelValue(
user
) | rpl::map([=] {
return user->personalChannelId()
&& user->personalChannelMessageId();
}));
messageChannelWrap->finishAnimating();
const auto clear = [=] {