Skip to content

Commit

Permalink
fix: 🐛 fixes cards returned in review session
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliosheinz committed May 1, 2023
1 parent bafa1a0 commit 35e7f63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/api/routers/study-session/study-session.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ export const studySessionRouter = createTRPCRouter({
cards: studySessionBoxCards
.filter(boxCard => {
const lastAttempt = boxCard.studySessionAttempts[0]?.createdAt
return !lastAttempt || !lastReview || lastAttempt < lastReview

if (!lastAttempt) return true
if (!lastReview) return false

return lastAttempt < lastReview
})
.map(boxCard => ({
id: boxCard.card.id,
Expand Down

0 comments on commit 35e7f63

Please sign in to comment.