From 40e46e84801f492d17173692374396d239958cec Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 13 Apr 2021 15:30:37 +0400 Subject: [PATCH] Hide webview progress instantly. --- .../SourceFiles/payments/ui/payments_panel.cpp | 15 +++++++++------ Telegram/lib_webview | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/payments/ui/payments_panel.cpp b/Telegram/SourceFiles/payments/ui/payments_panel.cpp index 8cb9453882..bfb4729153 100644 --- a/Telegram/SourceFiles/payments/ui/payments_panel.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_panel.cpp @@ -78,9 +78,6 @@ void Panel::requestActivate() { } void Panel::toggleProgress(bool shown) { - if (!shown) { - _webviewProgress = false; - } if (!_progress) { if (!shown) { return; @@ -435,7 +432,7 @@ void Panel::showEditPaymentMethod(const PaymentMethodDetails &method) { } void Panel::showWebviewProgress() { - if (_webviewProgress) { + if (_webviewProgress && _progress && _progress->shown) { return; } _webviewProgress = true; @@ -507,7 +504,12 @@ bool Panel::createWebview() { QObject::connect(container.get(), &QObject::destroyed, [=] { if (_webview.get() == raw) { _webview = nullptr; - hideWebviewProgress(); + if (_webviewProgress) { + hideWebviewProgress(); + if (!_progress->shown) { + _progress = nullptr; + } + } } if (_webviewBottom.get() == bottom) { _webviewBottom = nullptr; @@ -686,7 +688,8 @@ void Panel::showToast(const TextWithEntities &text) { } void Panel::showCriticalError(const TextWithEntities &text) { - toggleProgress(false); + _progress = nullptr; + _webviewProgress = false; if (!_weakFormSummary || !_weakFormSummary->showCriticalError(text)) { auto error = base::make_unique_q>( _widget.get(), diff --git a/Telegram/lib_webview b/Telegram/lib_webview index d7caf94d64..70d10e605b 160000 --- a/Telegram/lib_webview +++ b/Telegram/lib_webview @@ -1 +1 @@ -Subproject commit d7caf94d64aebb6720712150457cfb1c0d5f7ca0 +Subproject commit 70d10e605b5e4673d76cc56fcb30d8dc60cd9dfe