From bfa21d4896138e6c4bc637693e994d0e087e2461 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 30 Sep 2026 14:06:11 +0200 Subject: [PATCH] fix(vocab): never hide due batch behind zero quota --- frontend/src/views/social/VocabCourseView.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/social/VocabCourseView.vue b/frontend/src/views/social/VocabCourseView.vue index ec412e8..5c7c6b4 100755 --- a/frontend/src/views/social/VocabCourseView.vue +++ b/frontend/src/views/social/VocabCourseView.vue @@ -455,13 +455,16 @@ export default { srsDailyCount() { // A valid current-day session represents the fixed daily batch. Without // one, the server's due count determines the first batch (max. 50). - if (Number.isFinite(Number(this.srsTodayRemaining))) { + // A zero-card session is never a valid batch while the server still + // reports due items. Otherwise the UI can incorrectly show "0 of 0" + // even though there is a backlog to start today. + if (this.srsDailyQuota > 0 && Number.isFinite(Number(this.srsTodayRemaining))) { return Math.max(0, Number(this.srsTodayRemaining)); } return Math.min(this.srsDueCount, this.srsDailyLimit); }, srsDailyQuota() { - if (Number.isFinite(Number(this.srsTodayQuota))) { + if (Number.isFinite(Number(this.srsTodayQuota)) && Number(this.srsTodayQuota) > 0) { return Math.max(0, Number(this.srsTodayQuota)); } return Math.min(this.srsDueCount, this.srsDailyLimit); @@ -1028,7 +1031,10 @@ export default { onClose: () => this.refreshHardVocabList() }); }, - openSrsPractice() { + async openSrsPractice() { + // Refresh immediately before opening. The status dialog may have been + // opened while a stale empty session was still in local storage. + await this.loadSrsDueItems(); if (!this.srsDueItems.length) { return; }