mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +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
|
|
@ -126,7 +126,6 @@ func getRiffDueCards(c *gin.Context) {
|
||||||
ret.Data = cards
|
ret.Data = cards
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 删除闪卡
|
|
||||||
func removeRiffCards(c *gin.Context) {
|
func removeRiffCards(c *gin.Context) {
|
||||||
ret := gulu.Ret.NewResult()
|
ret := gulu.Ret.NewResult()
|
||||||
defer c.JSON(http.StatusOK, ret)
|
defer c.JSON(http.StatusOK, ret)
|
||||||
|
|
|
||||||
|
|
@ -602,6 +602,12 @@ func AddFlashcards(deckID string, blockIDs []string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, blockID := range blockIDs {
|
for _, blockID := range blockIDs {
|
||||||
|
cards := deck.GetCardsByBlockID(blockID)
|
||||||
|
if 0 < len(cards) {
|
||||||
|
// 一个块只能添加生成一张闪卡 https://github.com/siyuan-note/siyuan/issues/7476
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
cardID := ast.NewNodeID()
|
cardID := ast.NewNodeID()
|
||||||
deck.AddCard(cardID, blockID)
|
deck.AddCard(cardID, blockID)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue