mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 03:40:04 -06:00
🎨 一个块只能添加生成一张闪卡 https://github.com/siyuan-note/siyuan/issues/7476
This commit is contained in:
@@ -126,7 +126,6 @@ func getRiffDueCards(c *gin.Context) {
|
||||
ret.Data = cards
|
||||
}
|
||||
|
||||
// TODO 删除闪卡
|
||||
func removeRiffCards(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user