Respected admin rights in subsections slider for reordering.

This commit is contained in:
23rd
2025-09-20 17:15:26 +03:00
committed by John Preston
parent b01f70176b
commit 388e9cec09
@@ -341,6 +341,19 @@ void SubsectionTabs::startScrollChecking(
refreshAroundMiddle(scroll, slider);
}
}, scroll->lifetime());
session().changes().peerUpdates(
Data::PeerUpdate::Flag::Rights
) | rpl::filter([=](const Data::PeerUpdate &update) {
return (update.peer == _history->peer);
}) | rpl::start_with_next([=] {
if (_reorder) {
_reorder->cancel();
if (_history->peer->canManageTopics()) {
_reorder->start();
}
}
}, _lifetime);
}
void SubsectionTabs::startFillingSlider(
@@ -517,7 +530,9 @@ void SubsectionTabs::startFillingSlider(
Assert(slider->sectionsCount() == _slice.size());
_reorder->cancel();
_reorder->start();
if (_history->peer->canManageTopics()) {
_reorder->start();
}
if (ignoreActiveScroll) {
Assert(scrollSavingIndex < slider->sectionsCount());