mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
fix due counts on undo/edit
This commit is contained in:
parent
ccf571290b
commit
96748e8621
3 changed files with 6 additions and 3 deletions
|
@ -45,7 +45,6 @@ class EditCurrent(QDialog):
|
|||
self.editor.setNote(None)
|
||||
r = self.mw.reviewer
|
||||
r.card.load()
|
||||
r.keep = True
|
||||
self.mw.moveToState("review")
|
||||
saveGeom(self, "editcurrent")
|
||||
self.close()
|
||||
|
|
|
@ -629,7 +629,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
|
|||
|
||||
def onUndo(self):
|
||||
cid = self.col.undo()
|
||||
if cid:
|
||||
if cid and self.state == "review":
|
||||
card = self.col.getCard(cid)
|
||||
self.reviewer.cardQueue.append(card)
|
||||
self.reset()
|
||||
|
|
|
@ -452,7 +452,11 @@ var updateTime = function () {
|
|||
def _remaining(self):
|
||||
if not self.mw.col.conf['dueCounts']:
|
||||
return ""
|
||||
counts = list(self.mw.col.sched.counts(self.card))
|
||||
if self.hadCardQueue:
|
||||
# if it's come from the undo queue, don't count it separately
|
||||
counts = list(self.mw.col.sched.counts())
|
||||
else:
|
||||
counts = list(self.mw.col.sched.counts(self.card))
|
||||
idx = self.mw.col.sched.countIdx(self.card)
|
||||
counts[idx] = "<u>%s</u>" % (counts[idx])
|
||||
space = " + "
|
||||
|
|
Loading…
Reference in a new issue