Fix premium users deselection in multi-select field.
This commit is contained in:
parent
0152d2c48e
commit
7c44cda76e
|
@ -159,8 +159,6 @@ public:
|
||||||
-> rpl::producer<RowSelectionChange>;
|
-> rpl::producer<RowSelectionChange>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
[[nodiscard]] std::unique_ptr<PeerListRow> createRow() const;
|
|
||||||
|
|
||||||
const not_null<Main::Session*> _session;
|
const not_null<Main::Session*> _session;
|
||||||
bool _premiums = false;
|
bool _premiums = false;
|
||||||
|
|
||||||
|
@ -331,6 +329,9 @@ auto PrivacyExceptionsBoxController::preparePremiumsRowList()
|
||||||
|
|
||||||
_deselectOption = [=](PeerListRowId itemId) {
|
_deselectOption = [=](PeerListRowId itemId) {
|
||||||
if (const auto row = _typesDelegate->peerListFindRow(itemId)) {
|
if (const auto row = _typesDelegate->peerListFindRow(itemId)) {
|
||||||
|
if (itemId == kPremiumsRowId) {
|
||||||
|
_selected.premiums = false;
|
||||||
|
}
|
||||||
_typesDelegate->peerListSetRowChecked(row, false);
|
_typesDelegate->peerListSetRowChecked(row, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1039,11 +1039,9 @@ void PeerListContent::changeCheckState(
|
||||||
not_null<PeerListRow*> row,
|
not_null<PeerListRow*> row,
|
||||||
bool checked,
|
bool checked,
|
||||||
anim::type animated) {
|
anim::type animated) {
|
||||||
row->setChecked(
|
row->setChecked(checked, _st.item.checkbox, animated, [=] {
|
||||||
checked,
|
updateRow(row);
|
||||||
_st.item.checkbox,
|
});
|
||||||
animated,
|
|
||||||
[=] { updateRow(row); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerListContent::setRowHidden(not_null<PeerListRow*> row, bool hidden) {
|
void PeerListContent::setRowHidden(not_null<PeerListRow*> row, bool hidden) {
|
||||||
|
|
Loading…
Reference in New Issue