Change default for business recipients.

This commit is contained in:
John Preston 2024-02-23 09:17:13 +04:00
parent dd0bdd62fb
commit c513906996
2 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ struct BusinessChats {
struct BusinessRecipients {
BusinessChats included;
BusinessChats excluded;
bool onlyIncluded = false;
bool allButExcluded = false;
friend inline bool operator==(
const BusinessRecipients &a,

View File

@ -165,7 +165,7 @@ void AddBusinessRecipientsSelector(
*data = std::move(now);
};
const auto group = std::make_shared<Ui::RadiobuttonGroup>(
data->current().onlyIncluded ? kSelectedOnly : kAllExcept);
data->current().allButExcluded ? kAllExcept : kSelectedOnly);
const auto everyone = container->add(
object_ptr<Ui::Radiobutton>(
container,
@ -231,7 +231,7 @@ void AddBusinessRecipientsSelector(
excludeWrap->toggleOn(data->value(
) | rpl::map([](const Data::BusinessRecipients &value) {
return !value.onlyIncluded;
return value.allButExcluded;
}));
excludeWrap->finishAnimating();
@ -280,13 +280,13 @@ void AddBusinessRecipientsSelector(
includeWrap->toggleOn(data->value(
) | rpl::map([](const Data::BusinessRecipients &value) {
return value.onlyIncluded;
return !value.allButExcluded;
}));
includeWrap->finishAnimating();
group->setChangedCallback([=](int value) {
change([&](Data::BusinessRecipients &data) {
data.onlyIncluded = (value == kSelectedOnly);
data.allButExcluded = (value == kAllExcept);
});
});
}