mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix error when opening and closing editor rapidly
This commit is contained in:
parent
84e2cfbe3f
commit
422584b814
1 changed files with 3 additions and 1 deletions
|
@ -491,6 +491,8 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{
|
|||
|
||||
def _check_and_update_duplicate_display_async(self) -> None:
|
||||
note = self.note
|
||||
if not note:
|
||||
return
|
||||
|
||||
def on_done(result: DuplicateOrEmptyResult.V) -> None:
|
||||
if self.note != note:
|
||||
|
@ -499,7 +501,7 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{
|
|||
|
||||
QueryOp(
|
||||
parent=self.parentWindow,
|
||||
op=lambda _: self.note.duplicate_or_empty(),
|
||||
op=lambda _: note.duplicate_or_empty(),
|
||||
success=on_done,
|
||||
).run_in_background()
|
||||
|
||||
|
|
Loading…
Reference in a new issue