Skip to content

Commit 5d000c2

Browse files
committed
Fix: Retrieve all associated cardIds of a note and update instead of just the currentEditedCard
1 parent bade811 commit 5d000c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,10 @@ class NoteEditor :
12611261
// changed did? this has to be done first as remFromDyn() involves a direct write to the database
12621262
if (currentEditedCard != null && currentEditedCard!!.currentDeckId() != deckId) {
12631263
reloadRequired = true
1264-
undoableOp { setDeck(listOf(currentEditedCard!!.id), deckId) }
1264+
// Obtain all card IDs for the current note
1265+
val allCardIds = editorNote!!.cardIds(getColUnsafe)
1266+
// Update the deck for every card of that note
1267+
undoableOp { setDeck(allCardIds, deckId) }
12651268
// refresh the card object to reflect the database changes from above
12661269
currentEditedCard!!.load(getColUnsafe)
12671270
// also reload the note object

0 commit comments

Comments
 (0)