mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 06:41:44 +08:00
🎨 Improve flashcard import https://github.com/siyuan-note/siyuan/issues/14402
This commit is contained in:
parent
9945ad7a7a
commit
b883f07cb4
@ -936,8 +936,7 @@ func (tx *Transaction) doAddFlashcards(operation *Operation) (ret *TxErr) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
cardID := ast.NewNodeID()
|
deck.AddCard(ast.NewNodeID(), blockID)
|
||||||
deck.AddCard(cardID, blockID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := deck.Save(); err != nil {
|
if err := deck.Save(); err != nil {
|
||||||
|
@ -352,7 +352,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||||||
bIDs := deckToImport.GetBlockIDs()
|
bIDs := deckToImport.GetBlockIDs()
|
||||||
cards := deckToImport.GetCardsByBlockIDs(bIDs)
|
cards := deckToImport.GetCardsByBlockIDs(bIDs)
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
deck.AddCard(card.ID(), blockIDs[card.BlockID()])
|
deck.AddCard(ast.NewNodeID(), blockIDs[card.BlockID()])
|
||||||
}
|
}
|
||||||
|
|
||||||
if 0 < len(cards) {
|
if 0 < len(cards) {
|
||||||
|
Loading…
Reference in New Issue
Block a user