Fix initial stories collapsing in chats list.

This commit is contained in:
John Preston 2023-05-26 19:51:56 +04:00
parent 0edbb91b72
commit cdd4774bb8
2 changed files with 9 additions and 3 deletions

View File

@ -328,6 +328,7 @@ InnerWidget::InnerWidget(
) | rpl::filter([=] {
return (_viewportHeight > 0) && (defaultScrollTop() > _visibleTop);
}) | rpl::start_with_next([=] {
refreshForDefaultScroll();
jumpToTop();
}, lifetime());
@ -1735,9 +1736,7 @@ void InnerWidget::mousePressReleased(
void InnerWidget::setViewportHeight(int viewportHeight) {
if (_viewportHeight != viewportHeight) {
_viewportHeight = viewportHeight;
if (height() < defaultScrollTop() + viewportHeight) {
refresh();
}
refreshForDefaultScroll();
}
}
@ -2766,6 +2765,12 @@ void InnerWidget::editOpenedFilter() {
}
}
void InnerWidget::refreshForDefaultScroll() {
if (height() < defaultScrollTop() + _viewportHeight) {
refresh();
}
}
void InnerWidget::refresh(bool toTop) {
if (!_geometryInited) {
return;

View File

@ -122,6 +122,7 @@ public:
void clearFilter();
void refresh(bool toTop = false);
void refreshForDefaultScroll();
void refreshEmptyLabel();
void resizeEmptyLabel();