mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
update sync status after profile open sync
https://forums.ankiweb.net/t/why-is-my-sync-button-blue/2078/15
This commit is contained in:
parent
2c38ccad98
commit
e38cecd88a
1 changed files with 9 additions and 6 deletions
|
@ -405,9 +405,12 @@ class AnkiQt(QMainWindow):
|
|||
self.pendingImport = None
|
||||
gui_hooks.profile_did_open()
|
||||
|
||||
if onsuccess is None:
|
||||
onsuccess = lambda: None
|
||||
self.maybe_auto_sync_on_open_close(onsuccess)
|
||||
def _onsuccess():
|
||||
self._refresh_after_sync()
|
||||
if onsuccess:
|
||||
onsuccess()
|
||||
|
||||
self.maybe_auto_sync_on_open_close(_onsuccess)
|
||||
|
||||
def unloadProfile(self, onsuccess: Callable) -> None:
|
||||
def callback():
|
||||
|
@ -868,12 +871,12 @@ title="%s" %s>%s</button>""" % (
|
|||
if not auth:
|
||||
sync_login(
|
||||
self,
|
||||
lambda: self._sync_collection_and_media(self._after_manual_sync),
|
||||
lambda: self._sync_collection_and_media(self._refresh_after_sync),
|
||||
)
|
||||
else:
|
||||
self._sync_collection_and_media(self._after_manual_sync)
|
||||
self._sync_collection_and_media(self._refresh_after_sync)
|
||||
|
||||
def _after_manual_sync(self):
|
||||
def _refresh_after_sync(self):
|
||||
self.toolbar.redraw()
|
||||
|
||||
def _sync_collection_and_media(self, after_sync: Callable[[], None]):
|
||||
|
|
Loading…
Reference in a new issue