Skip to content

Commit 50f8fa9

Browse files
xenonnn4wmikehardy
authored andcommitted
fix(widgets): opening filtered decks
Replace DeckWidgetData.filtered with dynamic check via isFiltered() Fixes 18590
1 parent ff4a5c6 commit 50f8fa9

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

AnkiDroid/src/main/java/com/ichi2/widget/cardanalysis/CardAnalysisWidget.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class CardAnalysisWidget : AnalyticsWidgetProvider() {
166166
appWidgetManager.updateAppWidget(appWidgetId, remoteViews)
167167
}
168168

169-
private fun showDeck(
169+
private suspend fun showDeck(
170170
context: Context,
171171
appWidgetManager: AppWidgetManager,
172172
appWidgetId: Int,
@@ -189,7 +189,7 @@ class CardAnalysisWidget : AnalyticsWidgetProvider() {
189189
if (!isEmptyDeck) {
190190
intentToReviewDeckFromShorcuts(context, deckData.deckId)
191191
} else {
192-
DeckOptionsDestination(deckData.deckId, deckData.filtered).toIntent(context)
192+
DeckOptionsDestination.fromDeckId(deckData.deckId).toIntent(context)
193193
}
194194
val pendingIntent =
195195
PendingIntent.getActivity(

AnkiDroid/src/main/java/com/ichi2/widget/deckpicker/DeckPickerWidget.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ typealias AppWidgetId = Int
5050
* @property reviewCount The number of cards due for review.
5151
* @property learnCount The number of cards in the learning phase.
5252
* @property newCount The number of new cards.
53-
* @property filtered Whether the deck is filtered.
5453
*/
5554
data class DeckWidgetData(
5655
val deckId: DeckId,
5756
val name: String,
5857
val reviewCount: Int,
5958
val learnCount: Int,
6059
val newCount: Int,
61-
val filtered: Boolean,
6260
)
6361

6462
/**
@@ -382,7 +380,6 @@ suspend fun getDeckNamesAndStats(deckIds: List<DeckId>): List<DeckWidgetData> {
382380
reviewCount = node.revCount,
383381
learnCount = node.lrnCount,
384382
newCount = node.newCount,
385-
filtered = node.filtered,
386383
),
387384
)
388385
}

0 commit comments

Comments
 (0)