mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Prevent error when double-tapping delete key in browser
on_all_or_selected_rows_changed() unsets the editor note, but it is called too late - by that time the note has already been deleted, and the editor sometimes tries to save the deleted note due to an unfocus/ key timeout. https://forums.ankiweb.net/t/two-suppr-lead-to-an-empty-warning/20860 Will need to check that this does not regression when #1691 is merged.
This commit is contained in:
parent
e5a74838c9
commit
05adb50153
1 changed files with 1 additions and 0 deletions
|
@ -684,6 +684,7 @@ class Browser(QMainWindow):
|
||||||
if focus != self.form.tableView:
|
if focus != self.form.tableView:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.editor.set_note(None)
|
||||||
nids = self.table.to_row_of_unselected_note()
|
nids = self.table.to_row_of_unselected_note()
|
||||||
remove_notes(parent=self, note_ids=nids).run_in_background()
|
remove_notes(parent=self, note_ids=nids).run_in_background()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue