aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/db/index.ts1
-rw-r--r--src/client/pages/StudyPage.tsx20
2 files changed, 6 insertions, 15 deletions
diff --git a/src/client/db/index.ts b/src/client/db/index.ts
index 53df476..59cc526 100644
--- a/src/client/db/index.ts
+++ b/src/client/db/index.ts
@@ -243,7 +243,6 @@ export class KiokuDatabase extends Dexie {
});
// Version 3: noteId and isReversed are now required (NOT NULL)
- // No migration needed as production has no legacy data without notes
this.version(3).stores({
decks: "id, userId, updatedAt",
cards: "id, deckId, noteId, updatedAt, due, state",
diff --git a/src/client/pages/StudyPage.tsx b/src/client/pages/StudyPage.tsx
index eccdb50..92d655e 100644
--- a/src/client/pages/StudyPage.tsx
+++ b/src/client/pages/StudyPage.tsx
@@ -188,23 +188,15 @@ function StudySession({ deckId }: { deckId: string }) {
const hasNoCards = cards.length === 0;
const remainingCards = cards.length - currentIndex;
- // Compute rendered card content for both legacy and note-based cards
const cardContent = useMemo(() => {
if (!currentCard) return null;
- // Note-based card: use template rendering
- if (currentCard.noteType && currentCard.fieldValuesMap) {
- const rendered = renderCard({
- frontTemplate: currentCard.noteType.frontTemplate,
- backTemplate: currentCard.noteType.backTemplate,
- fieldValues: currentCard.fieldValuesMap,
- isReversed: currentCard.isReversed ?? false,
- });
- return { front: rendered.front, back: rendered.back };
- }
-
- // Legacy card: use front/back directly
- return { front: currentCard.front, back: currentCard.back };
+ return renderCard({
+ frontTemplate: currentCard.noteType.frontTemplate,
+ backTemplate: currentCard.noteType.backTemplate,
+ fieldValues: currentCard.fieldValuesMap,
+ isReversed: currentCard.isReversed ?? false,
+ });
}, [currentCard]);
return (