mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 23:08:49 +01:00
This commit is contained in:
parent
a767572f8e
commit
a76cfb442c
1 changed files with 9 additions and 1 deletions
|
|
@ -164,6 +164,7 @@ func RemoveFlashcards(deckID string, blockIDs []string) (err error) {
|
|||
}
|
||||
rootIDs = gulu.Str.RemoveDuplicatedElem(rootIDs)
|
||||
|
||||
availableDeckIDs := getDeckIDs()
|
||||
trees := map[string]*parse.Tree{}
|
||||
for _, blockID := range blockIDs {
|
||||
rootID := blockRoots[blockID]
|
||||
|
|
@ -187,7 +188,7 @@ func RemoveFlashcards(deckID string, blockIDs []string) (err error) {
|
|||
deckAttrs := node.IALAttr("custom-riff-decks")
|
||||
var deckIDs []string
|
||||
for _, dID := range strings.Split(deckAttrs, ",") {
|
||||
if dID != deckID {
|
||||
if dID != deckID && gulu.Str.Contains(dID, availableDeckIDs) {
|
||||
deckIDs = append(deckIDs, dID)
|
||||
}
|
||||
}
|
||||
|
|
@ -434,3 +435,10 @@ func GetDecks() (decks []*riff.Deck) {
|
|||
func getRiffDir() string {
|
||||
return filepath.Join(util.DataDir, "storage", "riff")
|
||||
}
|
||||
|
||||
func getDeckIDs() (deckIDs []string) {
|
||||
for deckID := range Decks {
|
||||
deckIDs = append(deckIDs, deckID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue