Fix cancel of bot app confirm.

This commit is contained in:
John Preston 2024-07-31 18:59:13 +02:00
parent 813d0501da
commit a422aec99a

View file

@ -787,6 +787,10 @@ void WebViewInstance::confirmAppOpen(
done((*allowed) && (*allowed)->checked());
close();
};
const auto cancelled = [=](Fn<void()> close) {
botClose();
close();
};
Ui::ConfirmBox(box, {
tr::lng_allow_bot_webview(
tr::now,
@ -794,7 +798,7 @@ void WebViewInstance::confirmAppOpen(
Ui::Text::Bold(_bot->name()),
Ui::Text::RichLangValue),
crl::guard(this, callback),
crl::guard(this, [=] { botClose(); }),
crl::guard(this, cancelled),
});
if (writeAccess) {
(*allowed) = box->addRow(