mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Support channel stories archive.
This commit is contained in:
@@ -859,16 +859,19 @@ void MainMenu::setupMenu() {
|
||||
tr::lng_menu_my_stories(),
|
||||
st::mainMenuButton,
|
||||
IconDescriptor{ &st::menuIconStoriesSavedSection })));
|
||||
const auto selfId = controller->session().userPeerId();
|
||||
const auto stories = &controller->session().data().stories();
|
||||
if (stories->archiveCount() > 0) {
|
||||
if (stories->archiveCount(selfId) > 0) {
|
||||
wrap->toggle(true, anim::type::instant);
|
||||
} else {
|
||||
wrap->toggle(false, anim::type::instant);
|
||||
if (!stories->archiveCountKnown()) {
|
||||
stories->archiveLoadMore();
|
||||
if (!stories->archiveCountKnown(selfId)) {
|
||||
stories->archiveLoadMore(selfId);
|
||||
wrap->toggleOn(stories->archiveChanged(
|
||||
) | rpl::filter(
|
||||
rpl::mappers::_1 == selfId
|
||||
) | rpl::map([=] {
|
||||
return stories->archiveCount() > 0;
|
||||
return stories->archiveCount(selfId) > 0;
|
||||
}) | rpl::filter(rpl::mappers::_1) | rpl::take(1));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user