aboutsummaryrefslogtreecommitdiff
path: root/srs-anywhere.js
diff options
context:
space:
mode:
Diffstat (limited to 'srs-anywhere.js')
-rw-r--r--srs-anywhere.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/srs-anywhere.js b/srs-anywhere.js
index 4efed9b..8e0af3b 100644
--- a/srs-anywhere.js
+++ b/srs-anywhere.js
@@ -386,6 +386,11 @@ function loadCards(data) {
document.getElementById('rating-button-easy')
.addEventListener('click', () => rateCard('easy'));
+ const maxCards = SRS_ANYWHERE_CONFIG.maxCardsPerSession;
+ if (maxCards !== null && maxCards > 0) {
+ window.maxCards = maxCards;
+ }
+
const cramEnabled = document.getElementById('cram-mode-checkbox').checked;
if (cramEnabled) {
@@ -396,7 +401,7 @@ function loadCards(data) {
today.setHours(0, 0, 0, 0);
window.cards = data.filter((card) => {
return (new Date(card._scheduled)) <= today;
- });
+ }).slice(0, window.maxCards || data.length);
}
shuffleArray(window.cards);

© 2015 - 2026 Jakob L. Kreuze