mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
fix stuck webview issue
A race condition could cause domDone to get stuck on false, causing any further bridge messages and setHtml() calls to be ignored. Fix the issue by clearing pending actions and resetting domDone when setting HTML.
This commit is contained in:
parent
eb46a8509a
commit
6594f62f5d
1 changed files with 3 additions and 0 deletions
|
@ -170,6 +170,9 @@ class AnkiWebView(QWebEngineView):
|
|||
pass
|
||||
|
||||
def setHtml(self, html):
|
||||
# discard any previous pending actions
|
||||
self._pendingActions = []
|
||||
self._domDone = True
|
||||
self._queueAction("setHtml", html)
|
||||
|
||||
def _setHtml(self, html):
|
||||
|
|
Loading…
Reference in a new issue