mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
parent
36db1105a2
commit
f4864cddc9
1 changed files with 6 additions and 1 deletions
|
@ -505,7 +505,7 @@ bool Panel::showWebview(
|
||||||
_webview->window.navigate(url);
|
_webview->window.navigate(url);
|
||||||
_widget->setBackAllowed(allowBack);
|
_widget->setBackAllowed(allowBack);
|
||||||
_widget->setMenuAllowed([=](const Ui::Menu::MenuCallback &callback) {
|
_widget->setMenuAllowed([=](const Ui::Menu::MenuCallback &callback) {
|
||||||
if (_hasSettingsButton) {
|
if (_webview && _webview->window.widget() && _hasSettingsButton) {
|
||||||
callback(tr::lng_bot_settings(tr::now), [=] {
|
callback(tr::lng_bot_settings(tr::now), [=] {
|
||||||
postEvent("settings_button_pressed");
|
postEvent("settings_button_pressed");
|
||||||
}, &st::menuIconSettings);
|
}, &st::menuIconSettings);
|
||||||
|
@ -1294,6 +1294,11 @@ void Panel::postEvent(const QString &event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel::postEvent(const QString &event, EventData data) {
|
void Panel::postEvent(const QString &event, EventData data) {
|
||||||
|
if (!_webview) {
|
||||||
|
LOG(("BotWebView Error: Post event \"%1\" on crashed webview."
|
||||||
|
).arg(event));
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto written = v::is<QString>(data)
|
auto written = v::is<QString>(data)
|
||||||
? v::get<QString>(data).toUtf8()
|
? v::get<QString>(data).toUtf8()
|
||||||
: QJsonDocument(
|
: QJsonDocument(
|
||||||
|
|
Loading…
Add table
Reference in a new issue