mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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
|
self.pendingImport = None
|
||||||
gui_hooks.profile_did_open()
|
gui_hooks.profile_did_open()
|
||||||
|
|
||||||
if onsuccess is None:
|
def _onsuccess():
|
||||||
onsuccess = lambda: None
|
self._refresh_after_sync()
|
||||||
self.maybe_auto_sync_on_open_close(onsuccess)
|
if onsuccess:
|
||||||
|
onsuccess()
|
||||||
|
|
||||||
|
self.maybe_auto_sync_on_open_close(_onsuccess)
|
||||||
|
|
||||||
def unloadProfile(self, onsuccess: Callable) -> None:
|
def unloadProfile(self, onsuccess: Callable) -> None:
|
||||||
def callback():
|
def callback():
|
||||||
|
@ -868,12 +871,12 @@ title="%s" %s>%s</button>""" % (
|
||||||
if not auth:
|
if not auth:
|
||||||
sync_login(
|
sync_login(
|
||||||
self,
|
self,
|
||||||
lambda: self._sync_collection_and_media(self._after_manual_sync),
|
lambda: self._sync_collection_and_media(self._refresh_after_sync),
|
||||||
)
|
)
|
||||||
else:
|
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()
|
self.toolbar.redraw()
|
||||||
|
|
||||||
def _sync_collection_and_media(self, after_sync: Callable[[], None]):
|
def _sync_collection_and_media(self, after_sync: Callable[[], None]):
|
||||||
|
|
Loading…
Reference in a new issue