Correctly handle shareable->non-shareable conversion.

This commit is contained in:
John Preston 2023-04-24 21:39:21 +04:00
parent f0acc9526e
commit 5ad4719c08
1 changed files with 9 additions and 5 deletions

View File

@ -556,11 +556,12 @@ void EditFilterBox(
state->hasLinks = state->links.value() | rpl::map([=](const auto &v) {
return !v.empty();
});
if (!state->chatlist.current()) {
state->chatlist = state->hasLinks.value() | rpl::filter(
_1
) | rpl::take(1);
}
state->hasLinks.value() | rpl::filter(
_1
) | rpl::start_with_next([=] {
state->chatlist = true;
}, box->lifetime());
const auto data = &state->rules;
owner->chatsFilters().isChatlistChanged(
@ -574,6 +575,9 @@ void EditFilterBox(
return;
}
*data = data->current().withChatlist(i->chatlist(), i->hasMyLinks());
if (!i->chatlist() && !state->hasLinks.current()) {
state->chatlist = false;
}
}, box->lifetime());
box->setWidth(st::boxWideWidth);