Fix new forum layout search and topics list.

This commit is contained in:
John Preston
2025-06-05 13:55:55 +04:00
parent 08681ac1b9
commit 65cfd6c81c
4 changed files with 64 additions and 16 deletions
@@ -1876,9 +1876,10 @@ bool SessionController::showForumInDifferentWindow(
void SessionController::showForum(
not_null<Data::Forum*> forum,
const SectionShow &params) {
const auto forced = params.forceTopicsList;
if (showForumInDifferentWindow(forum, params)) {
return;
} else if (forum->channel()->useSubsectionTabs()) {
} else if (!forced && forum->channel()->useSubsectionTabs()) {
if (const auto active = forum->activeSubsectionThread()) {
showThread(active, ShowAtUnreadMsgId, params);
} else {
@@ -1914,20 +1915,26 @@ void SessionController::showForum(
});
}
};
content()->showForum(forum, params);
if (_shownForum.current() != forum) {
return;
}
forum->destroyed(
) | rpl::start_with_next([=] {
closeAndShowHistory(false);
}, _shownForumLifetime);
using FlagChange = Data::Flags<ChannelDataFlags>::Change;
forum->channel()->flagsValue(
) | rpl::start_with_next([=](FlagChange change) {
if (change.diff & ChannelDataFlag::ForumTabs) {
if (HistoryView::SubsectionTabs::UsedFor(history)) {
closeAndShowHistory(true);
if (!forced) {
using FlagChange = Data::Flags<ChannelDataFlags>::Change;
forum->channel()->flagsValue(
) | rpl::start_with_next([=](FlagChange change) {
if (change.diff & ChannelDataFlag::ForumTabs) {
if (HistoryView::SubsectionTabs::UsedFor(history)) {
closeAndShowHistory(true);
}
}
}
}, _shownForumLifetime);
content()->showForum(forum, params);
}, _shownForumLifetime);
}
}
void SessionController::closeForum() {