🎨 When deleting a referenced definition block, a pop-up window will prompt the user https://github.com/siyuan-note/siyuan/issues/13396

This commit is contained in:
Daniel 2025-03-16 20:04:08 +08:00
parent fe3caaaa6b
commit 5dab0ecdf6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 77 additions and 15 deletions

View file

@ -29,6 +29,7 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/open-spaced-repetition/go-fsrs/v3"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/riff"
@ -434,6 +435,21 @@ func getCardsBlocks(cards []riff.Card, page, pageSize int) (blocks []*Block, tot
return
}
func getRiffCard(card *fsrs.Card) *RiffCard {
due := card.Due
if due.IsZero() {
due = time.Now()
}
return &RiffCard{
Due: due,
Reps: card.Reps,
Lapses: card.Lapses,
State: card.State,
LastReview: card.LastReview,
}
}
var (
// reviewCardCache <cardID, card> 用于复习时缓存卡片,以便支持撤销。
reviewCardCache = map[string]riff.Card{}