Skip to content

Commit

Permalink
🎨 Try fill flashcard to db tpl #10502 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 9, 2024
1 parent 8b1f42a commit f163fbb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,18 +1138,18 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a

// 获取闪卡信息
flashcards := map[string]*Flashcard{}
deck := Decks[builtinDeckID]
if nil != deck {
var blockIDs []string
for _, row := range ret.Rows {
blockIDs = append(blockIDs, row.ID)
}
cards := deck.GetCardsByBlockIDs(blockIDs)
now := time.Now()
for _, card := range cards {
flashcards[card.BlockID()] = newFlashcard(card, builtinDeckID, now)
}
}
//deck := Decks[builtinDeckID]
//if nil != deck {
// var blockIDs []string
// for _, row := range ret.Rows {
// blockIDs = append(blockIDs, row.ID)
// }
// cards := deck.GetCardsByBlockIDs(blockIDs)
// now := time.Now()
// for _, card := range cards {
// flashcards[card.BlockID()] = newFlashcard(card, builtinDeckID, now)
// }
//}

for _, row := range ret.Rows {
for _, cell := range row.Cells {
Expand Down

0 comments on commit f163fbb

Please sign in to comment.