mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 05:18:49 +01:00
This commit is contained in:
parent
09657d004b
commit
9a1a69a3db
1 changed files with 10 additions and 8 deletions
|
|
@ -151,7 +151,6 @@ func RemoveFlashcards(deckID string, blockIDs []string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
deck := Decks[deckID]
|
||||
var rootIDs []string
|
||||
blockRoots := map[string]string{}
|
||||
for _, blockID := range blockIDs {
|
||||
|
|
@ -218,13 +217,16 @@ func RemoveFlashcards(deckID string, blockIDs []string) (err error) {
|
|||
pushBroadcastAttrTransactions(trans)
|
||||
}
|
||||
|
||||
for _, blockID := range blockIDs {
|
||||
deck.RemoveCard(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 {
|
||||
deck.RemoveCard(blockID)
|
||||
}
|
||||
err = deck.Save()
|
||||
if nil != err {
|
||||
logging.LogErrorf("save deck [%s] failed: %s", deckID, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue