Fixed rebuild of chats filters in strip when premium status is changed.

This commit is contained in:
23rd 2024-11-15 22:36:23 +03:00
parent 013b58f6f6
commit 8f1d215851

View file

@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/premium_limits_box.h"
#include "core/application.h"
#include "data/data_chat_filters.h"
#include "data/data_peer_values.h" // Data::AmPremiumValue.
#include "data/data_premium_limits.h"
#include "data/data_session.h"
#include "data/data_unread_value.h"
@ -312,6 +313,7 @@ not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
}, slider->lifetime());
if (state->reorder) {
state->reorder->cancel();
state->reorder->clearPinnedIntervals();
if (!reorderAll) {
state->reorder->addPinnedInterval(0, 1);
}
@ -405,7 +407,9 @@ not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
state->reorder->start();
}
};
session->data().chatsFilters().changed(
rpl::combine(
session->data().chatsFilters().changed(),
Data::AmPremiumValue(session) | rpl::to_empty
) | rpl::start_with_next(rebuild, wrap->lifetime());
rebuild();