Skip to content

Commit 2f08a01

Browse files
committed
add check against sessionTimer
1 parent b09e72c commit 2f08a01

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/db/src/study/SessionController.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,15 @@ export class SessionController<TView = unknown> extends Loggable {
296296
return null;
297297
}
298298

299+
// If timer expired, only return failed cards
300+
if (this._secondsRemaining <= 0) {
301+
if (this.failedQ.length > 0) {
302+
return this.failedQ.peek(0);
303+
} else {
304+
return null; // No more failed cards, session over
305+
}
306+
}
307+
299308
// supply new cards at start of session
300309
if (this.newQ.dequeueCount < this.sources.length && this.newQ.length) {
301310
return this.newQ.peek(0);

0 commit comments

Comments
 (0)