mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -240,7 +240,6 @@ func AddFlashcards(deckID string, blockIDs []string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
deck := Decks[deckID]
|
||||
var rootIDs []string
|
||||
blockRoots := map[string]string{}
|
||||
for _, blockID := range blockIDs {
|
||||
@@ -298,14 +297,17 @@ func AddFlashcards(deckID string, blockIDs []string) (err error) {
|
||||
pushBroadcastAttrTransactions(trans)
|
||||
}
|
||||
|
||||
for _, blockID := range blockIDs {
|
||||
cardID := ast.NewNodeID()
|
||||
deck.AddCard(cardID, blockID)
|
||||
}
|
||||
err = deck.Save()
|
||||
if nil != err {
|
||||
logging.LogErrorf("save deck [%s] failed: %s", deckID, err)
|
||||
return
|
||||
deck := Decks[deckID]
|
||||
if nil != deck {
|
||||
for _, blockID := range blockIDs {
|
||||
cardID := ast.NewNodeID()
|
||||
deck.AddCard(cardID, blockID)
|
||||
}
|
||||
err = deck.Save()
|
||||
if nil != err {
|
||||
logging.LogErrorf("save deck [%s] failed: %s", deckID, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user