Skip to content

Commit

Permalink
Fetching correct DeckID
Browse files Browse the repository at this point in the history
  • Loading branch information
soCallmeAdityaKumar committed Dec 16, 2024
1 parent 0ea255d commit a538e27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,11 @@ class NoteEditor :
fun calculateDeckId(): DeckId {
if (deckId != 0L) return deckId
if (note != null && !addNote && currentEditedCard != null) {
return currentEditedCard!!.currentDeckId().did
val deckId = currentEditedCard!!.currentDeckId().did
if (deckId == 0L && note.notetype.did != 0L) {
return note.notetype.did
}
return deckId
}

if (!getColUnsafe.config.getBool(ConfigKey.Bool.ADDING_DEFAULTS_TO_CURRENT_DECK)) {
Expand Down

0 comments on commit a538e27

Please sign in to comment.