Skip to content

Commit

Permalink
fix: currentDeckId broken
Browse files Browse the repository at this point in the history
In a58b4c1, `currentDeckId`
was updated to use a Kotlin-based builder, but `[this.]did` was
coming from `DeckIdKt.Dsl` rather than from `[this@Card.]did`

Cause 17591
Fixes 16704 (Note Editor issues)
  • Loading branch information
david-allison committed Dec 17, 2024
1 parent 3751f14 commit 0e04614
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ package com.ichi2.libanki
import androidx.annotation.VisibleForTesting
import anki.cards.FsrsMemoryState
import anki.decks.deckId
import anki.notes.noteId
import com.ichi2.anki.Flag
import com.ichi2.anki.utils.ext.ifZero
import com.ichi2.annotations.NeedsTest
import com.ichi2.libanki.Consts.CardQueue
import com.ichi2.libanki.Consts.CardType
import com.ichi2.libanki.TemplateManager.TemplateRenderContext.TemplateRenderOutput
Expand Down Expand Up @@ -233,7 +233,8 @@ open class Card : Cloneable {
}

@LibAnkiAlias("current_deck_id")
fun currentDeckId() = deckId { did = oDid.ifZero { did } }
@NeedsTest("Test upstream functionality which calls this")
fun currentDeckId() = deckId { did = oDid.ifZero { this@Card.did } }

/**
* Time limit for answering in milliseconds.
Expand Down

0 comments on commit 0e04614

Please sign in to comment.