mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
fix error when opening browser during review while notes mode active
This commit is contained in:
parent
097121424b
commit
9c8148ff0d
1 changed files with 5 additions and 4 deletions
|
@ -149,10 +149,11 @@ class Table:
|
||||||
def select_single_card(self, card_id: CardId) -> None:
|
def select_single_card(self, card_id: CardId) -> None:
|
||||||
"""Try to set the selection to the item corresponding to the given card."""
|
"""Try to set the selection to the item corresponding to the given card."""
|
||||||
self.clear_selection()
|
self.clear_selection()
|
||||||
try:
|
if self.is_notes_mode():
|
||||||
self._view.selectRow(self._model.get_card_row(card_id))
|
self._view.selectRow(0)
|
||||||
except ValueError:
|
else:
|
||||||
pass
|
if (row := self._model.get_card_row(card_id)) is not None:
|
||||||
|
self._view.selectRow(row)
|
||||||
|
|
||||||
# Reset
|
# Reset
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue