diff --git a/backend/services/frontend/handler/frontend.go b/backend/services/frontend/handler/frontend.go index 8729ea90..f91f3417 100644 --- a/backend/services/frontend/handler/frontend.go +++ b/backend/services/frontend/handler/frontend.go @@ -233,7 +233,7 @@ func (e *Frontend) SrsUserDueHandler(c *fiber.Ctx) error { } dueCards += rsp.DueCards newCards += rsp.NewCards - if rsp.DueCards > 0 { + if rsp.DueCards > 0 || rsp.NewCards > 0 { dueDecks++ } case pbCommon.AlgoType_LINEAR_SRS: @@ -248,7 +248,7 @@ func (e *Frontend) SrsUserDueHandler(c *fiber.Ctx) error { } dueCards += rsp.DueCards newCards += rsp.NewCards - if rsp.DueCards > 0 { + if rsp.DueCards > 0 || rsp.NewCards > 0 { dueDecks++ } case pbCommon.AlgoType_STATIC_SRS: @@ -263,7 +263,7 @@ func (e *Frontend) SrsUserDueHandler(c *fiber.Ctx) error { } dueCards += rsp.DueCards newCards += rsp.NewCards - if rsp.DueCards > 0 { + if rsp.DueCards > 0 || rsp.NewCards > 0 { dueDecks++ } case pbCommon.AlgoType_TEST_SRS: @@ -278,14 +278,14 @@ func (e *Frontend) SrsUserDueHandler(c *fiber.Ctx) error { } dueCards += rsp.DueCards newCards += rsp.NewCards - if rsp.DueCards > 0 { + if rsp.DueCards > 0 || rsp.NewCards > 0 { dueDecks++ } } } return c.JSON(converter.FiberGetDueResponseBody{ DueCards: dueCards, - NewCards: int64(newCards), + NewCards: newCards, DueDecks: dueDecks, }) } diff --git a/backend/store/postgres.go b/backend/store/postgres.go index 83e9c619..a35e7847 100644 --- a/backend/store/postgres.go +++ b/backend/store/postgres.go @@ -377,6 +377,7 @@ func (s *CardDeckStoreImpl) FindActiveDecks(ctx context.Context, userID string) } for _, deck := range userActiveDecks { deck.Deck.IsActive = true + deck.Deck.Algorithm = deck.Algorithm if err = s.PopulateDeckFavoriteAttribute(ctx, &deck.Deck, userID); err != nil { return }