From 43eca490a71c23eaef9d06b38d1c31272989069a Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 17 Jan 2024 10:16:12 +0400 Subject: [PATCH] Recreate webview on reload request after a crash. --- .../SourceFiles/ui/chat/attach/attach_bot_webview.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp index c94f26294..c34db9164 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp @@ -533,7 +533,14 @@ bool Panel::showWebview( }, &st::menuIconLeave); } callback(tr::lng_bot_reload_page(tr::now), [=] { - _webview->window.reload(); + if (_webview) { + _webview->window.reload(); + } else if (const auto params = _delegate->botThemeParams() + ; createWebview(params)) { + showWebviewProgress(); + updateThemeParams(params); + _webview->window.navigate(url); + } }, &st::menuIconRestore); const auto main = (_menuButtons & MenuButton::RemoveFromMainMenu); if (main || (_menuButtons & MenuButton::RemoveFromMenu)) {