Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 支持浏览卡包内的闪卡 https://github.com/siyuan-note/siyuan/issues/6943

Liang Ding192679eeddef
diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.go
index 8051c8c17c..6c6c3f211e 100644
--- a/kernel/model/flashcard.go
+++ b/kernel/model/flashcard.go
@@ -41,6 +41,7 @@ var Decks = map[string]*riff.Deck{}
var deckLock = sync.Mutex{}
func GetFlashcards(deckID string, page int) (blockIDs []string, total, pageCount int) {
+ blockIDs = []string{}
deck := Decks[deckID]
if nil == deck {
return
@@ -64,6 +65,9 @@ func GetFlashcards(deckID string, page int) (blockIDs []string, total, pageCount
blockIDs = allBlockIDs[start:end]
total = len(allBlockIDs)
pageCount = int(math.Ceil(float64(total) / float64(pageSize)))
+ if 1 > len(blockIDs) {
+ blockIDs = []string{}
+ }
return
}