fix sync deauth

This commit is contained in:
Damien Elmes 2020-02-15 17:48:35 +10:00
parent 319390f0c6
commit f6ddcd81df
2 changed files with 9 additions and 3 deletions

View File

@ -79,6 +79,9 @@ class MediaManager:
def dir(self) -> Any:
return self._dir
def force_resync(self) -> None:
os.unlink(media_paths_from_col_path(self.col.path)[1])
# File manipulation
##########################################################################

View File

@ -10,7 +10,7 @@ import aqt
from anki.lang import _
from aqt import AnkiQt
from aqt.qt import *
from aqt.utils import askUser, openHelp, showInfo
from aqt.utils import askUser, openHelp, showInfo, showWarning
class Preferences(QDialog):
@ -196,9 +196,12 @@ Not currently enabled; click the sync button in the main window to enable."""
)
)
def onSyncDeauth(self):
def onSyncDeauth(self) -> None:
if self.mw.media_syncer.is_syncing():
showWarning("Can't log out while sync in progress.")
return
self.prof["syncKey"] = None
self.mw.col.media.forceResync()
self.mw.col.media.force_resync()
self._hideAuth()
def updateNetwork(self):