Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1208,11 +1208,16 @@ open class Reviewer :
topCard.renderOutput(this@withCol, reload = true)
}
}
state?.timeboxReached?.let { dealWithTimeBox(it) }

currentCard = state?.topCard
queueState = state
}

/**
* Answer the current card, update the scheduler and checks if the timebox limit has been reached
* and, if so, displays a dialog to the user
* @param rating The user's rating for the card
*/
override suspend fun answerCardInner(rating: Rating) {
val state = queueState!!
val cardId = currentCard!!.id
Expand All @@ -1235,6 +1240,12 @@ open class Reviewer :
showSnackbar(leechMessage, Snackbar.LENGTH_SHORT)
}
}

// showing the timebox reached dialog if the timebox is reached
val timebox = withCol { timeboxReached() }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable: the same call is made in currentQueueState

if (timebox != null) {
dealWithTimeBox(timebox)
}
}

private suspend fun dealWithTimeBox(timebox: Collection.TimeboxReached) {
Expand Down