🎨 一个块只能添加生成一张闪卡 https://github.com/siyuan-note/siyuan/issues/7476

This commit is contained in:
Liang Ding 2023-02-25 11:51:07 +08:00
parent 5f875e9db2
commit 89fb0664f1
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 6 additions and 1 deletions

View file

@ -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)

View file

@ -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)
}