Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9b5c94c62e
1 changed files with 2 additions and 0 deletions
|
@ -137,6 +137,8 @@ func GetFlashcards(deckID string, page int) (blocks []*Block, total, pageCount i
|
|||
}
|
||||
|
||||
func getCardsBlocks(cards []riff.Card, page int) (blocks []*Block, total, pageCount int) {
|
||||
sort.Slice(cards, func(i, j int) bool { return cards[i].BlockID() < cards[j].BlockID() })
|
||||
|
||||
const pageSize = 20
|
||||
total = len(cards)
|
||||
pageCount = int(math.Ceil(float64(total) / float64(pageSize)))
|
||||
|
|
Loading…
Add table
Reference in a new issue