Fix emoji status set cancel.

Fixes #28674.
Fixes https://bugs.telegram.org/c/45691.
This commit is contained in:
John Preston 2024-11-21 10:01:31 +04:00
parent e70f50d837
commit 9532a2e3da

View file

@ -639,12 +639,13 @@ void ConfirmEmojiStatusBox(
done(true); done(true);
}); });
box->addButton(tr::lng_cancel(), [=] { box->addButton(tr::lng_cancel(), [=] {
const auto was = *set;
box->closeBox(); box->closeBox();
if (!was) { });
box->boxClosing() | rpl::start_with_next([=] {
if (!*set) {
done(false); done(false);
} }
}); }, box->lifetime());
} }
class BotAction final : public Ui::Menu::ItemBase { class BotAction final : public Ui::Menu::ItemBase {