mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +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);
|
||||
_widget->setBackAllowed(allowBack);
|
||||
_widget->setMenuAllowed([=](const Ui::Menu::MenuCallback &callback) {
|
||||
if (_hasSettingsButton) {
|
||||
if (_webview && _webview->window.widget() && _hasSettingsButton) {
|
||||
callback(tr::lng_bot_settings(tr::now), [=] {
|
||||
postEvent("settings_button_pressed");
|
||||
}, &st::menuIconSettings);
|
||||
|
@ -1294,6 +1294,11 @@ void Panel::postEvent(const QString &event) {
|
|||
}
|
||||
|
||||
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)
|
||||
? v::get<QString>(data).toUtf8()
|
||||
: QJsonDocument(
|
||||
|
|
Loading…
Add table
Reference in a new issue