mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-26 02:06:10 +01:00
🎨 一个块只能添加生成一张闪卡 https://github.com/siyuan-note/siyuan/issues/7476
This commit is contained in:
parent
5f875e9db2
commit
89fb0664f1
2 changed files with 6 additions and 1 deletions
|
|
@ -602,6 +602,12 @@ func AddFlashcards(deckID string, blockIDs []string) (err error) {
|
|||
}
|
||||
|
||||
for _, blockID := range blockIDs {
|
||||
cards := deck.GetCardsByBlockID(blockID)
|
||||
if 0 < len(cards) {
|
||||
// 一个块只能添加生成一张闪卡 https://github.com/siyuan-note/siyuan/issues/7476
|
||||
continue
|
||||
}
|
||||
|
||||
cardID := ast.NewNodeID()
|
||||
deck.AddCard(cardID, blockID)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue