Fix NotFoundError when opening browser after switching profiles (#1725)

This commit is contained in:
Hikaru Y 2022-03-21 13:45:22 +09:00 committed by GitHub
parent e2eff7deae
commit 704fb918c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -279,7 +279,7 @@ class AnkiQt(QMainWindow):
def showProfileManager(self) -> None:
self.pm.profile = None
self.state = "profileManager"
self.moveToState("profileManager")
d = self.profileDiag = self.ProfileManager()
f = self.profileForm = aqt.forms.profiles.Ui_MainWindow()
f.setupUi(d)
@ -669,7 +669,7 @@ class AnkiQt(QMainWindow):
self.clearStateShortcuts()
self.state = state
gui_hooks.state_will_change(state, oldState)
getattr(self, f"_{state}State")(oldState, *args)
getattr(self, f"_{state}State", lambda *_: None)(oldState, *args)
if state != "resetRequired":
self.bottomWeb.show()
gui_hooks.state_did_change(state, oldState)