mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Add some assertions for debugging a crash.
This commit is contained in:
parent
3c150d9742
commit
7dfb93f7c2
2 changed files with 7 additions and 1 deletions
|
@ -881,6 +881,8 @@ void AttachWebView::request(const WebViewButton &button) {
|
|||
}
|
||||
|
||||
void AttachWebView::cancel() {
|
||||
Expects(!_catchingCancelInShowCall);
|
||||
|
||||
ActiveWebViews().remove(this);
|
||||
_session->api().request(base::take(_requestId)).cancel();
|
||||
_session->api().request(base::take(_prolongId)).cancel();
|
||||
|
@ -1468,6 +1470,7 @@ void AttachWebView::show(
|
|||
_lastShownQueryId = queryId;
|
||||
_lastShownButtonText = buttonText;
|
||||
base::take(_panel);
|
||||
_catchingCancelInShowCall = true;
|
||||
_panel = Ui::BotWebView::Show({
|
||||
.url = url,
|
||||
.userDataPath = _session->domain().local().webviewDataPath(),
|
||||
|
@ -1477,11 +1480,13 @@ void AttachWebView::show(
|
|||
.menuButtons = buttons,
|
||||
.allowClipboardRead = allowClipboardRead,
|
||||
});
|
||||
_catchingCancelInShowCall = false;
|
||||
started(queryId);
|
||||
}
|
||||
|
||||
void AttachWebView::started(uint64 queryId) {
|
||||
Expects(_bot != nullptr && _context != nullptr);
|
||||
Expects(_bot != nullptr);
|
||||
Expects(_context != nullptr);
|
||||
|
||||
if (_context->fromSwitch || !queryId) {
|
||||
return;
|
||||
|
|
|
@ -267,6 +267,7 @@ private:
|
|||
base::flat_set<not_null<UserData*>> _disclaimerAccepted;
|
||||
|
||||
std::unique_ptr<Ui::BotWebView::Panel> _panel;
|
||||
bool _catchingCancelInShowCall = false;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue