🎨 Support resetting the learning progress of flashcards https://github.com/siyuan-note/siyuan/issues/9564

This commit is contained in:
Daniel 2023-11-17 00:05:30 +08:00
parent f78c5ab3c8
commit d81dfc503c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -44,6 +44,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
if 0 < len(blockIDs) {
if "" == deckID {
// 从全局管理进入时不会指定卡包 ID这时需要遍历所有卡包
for _, deck := range Decks {
allBlockIDs := deck.GetBlockIDs()
for _, blockID := range blockIDs {
@ -53,6 +54,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
}
}
if "" == deckID {
logging.LogWarnf("deck not found for blocks [%s]", strings.Join(blockIDs, ","))
continue
}
resetFlashcards(deckID, blockIDs)