mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Merge branch 'master' of https://github.com/hssm/anki
This commit is contained in:
commit
980c9d7305
1 changed files with 7 additions and 1 deletions
|
@ -606,13 +606,19 @@ where c.nid == f.id
|
||||||
if self._undo[0] == 1:
|
if self._undo[0] == 1:
|
||||||
old = self._undo[2]
|
old = self._undo[2]
|
||||||
self.clearUndo()
|
self.clearUndo()
|
||||||
self._undo = [1, _("Review"), old + [copy.copy(card)]]
|
wasLeech = card.note().hasTag("leech") or False
|
||||||
|
self._undo = [1, _("Review"), old + [copy.copy(card)], wasLeech]
|
||||||
|
|
||||||
def _undoReview(self):
|
def _undoReview(self):
|
||||||
data = self._undo[2]
|
data = self._undo[2]
|
||||||
|
wasLeech = self._undo[3]
|
||||||
c = data.pop()
|
c = data.pop()
|
||||||
if not data:
|
if not data:
|
||||||
self.clearUndo()
|
self.clearUndo()
|
||||||
|
# remove leech tag if it didn't have it before
|
||||||
|
if not wasLeech and c.note().hasTag("leech"):
|
||||||
|
c.note().delTag("leech")
|
||||||
|
c.note().flush()
|
||||||
# write old data
|
# write old data
|
||||||
c.flush()
|
c.flush()
|
||||||
# and delete revlog entry
|
# and delete revlog entry
|
||||||
|
|
Loading…
Reference in a new issue