Probable fix for crash when syncing from preferences

https://forums.ankiweb.net/t/windows-anki-24-04-1-crashes-with-self-hosted-sync-server/44849/6
This commit is contained in:
Damien Elmes 2024-05-21 23:08:08 +07:00
parent c4cd8808f3
commit 9a438ae87d
2 changed files with 4 additions and 1 deletions

View file

@ -230,7 +230,9 @@ class Preferences(QDialog):
self.update_login_status()
def confirm_sync_after_login(self) -> None:
if askUser(tr.preferences_login_successful_sync_now()):
from aqt import mw
if askUser(tr.preferences_login_successful_sync_now(), parent=mw):
self.accept_with_callback(self.mw.on_sync_button_clicked)
def update_network(self) -> None:

View file

@ -318,6 +318,7 @@ def sync_login(
username=username, password=password, endpoint=mw.pm.sync_endpoint()
),
on_future_done,
parent=mw,
)