mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Make sure to pass pending imports on to installAddon
also: refactor add-on check
This commit is contained in:
parent
f8df688648
commit
54253e2108
1 changed files with 8 additions and 2 deletions
|
@ -334,7 +334,10 @@ close the profile or restart Anki."""
|
|||
|
||||
# import pending?
|
||||
if self.pendingImport:
|
||||
self.handleImport(self.pendingImport)
|
||||
if self._isAddon(self.pendingImport):
|
||||
self.installAddon(self.pendingImport)
|
||||
else:
|
||||
self.handleImport(self.pendingImport)
|
||||
self.pendingImport = None
|
||||
runHook("profileLoaded")
|
||||
if onsuccess:
|
||||
|
@ -1482,7 +1485,7 @@ will be lost. Continue?"""
|
|||
self.app.appMsg.connect(self.onAppMsg)
|
||||
|
||||
def onAppMsg(self, buf: str) -> Optional[QTimer]:
|
||||
is_addon = buf.endswith(".ankiaddon")
|
||||
is_addon = self._isAddon(buf)
|
||||
|
||||
if self.state == "startup":
|
||||
# try again in a second
|
||||
|
@ -1531,6 +1534,9 @@ Please ensure a profile is open and Anki is not busy, then try again."""
|
|||
|
||||
return None
|
||||
|
||||
def _isAddon(self, buf: str) -> bool:
|
||||
return buf.endswith(self.addonManager.ext)
|
||||
|
||||
# GC
|
||||
##########################################################################
|
||||
# ensure gc runs in main thread
|
||||
|
|
Loading…
Reference in a new issue