@@ -155,7 +155,6 @@ open class CardBrowser :
155155 private lateinit var deckSpinnerSelection: DeckSpinnerSelection
156156 private var lastSelectedPosition = 0
157157 private var oldCardTopOffset: Int = 0
158- private var oldCardId: Long? = null
159158
160159 @VisibleForTesting
161160 lateinit var cardsListView: RecyclerView
@@ -356,14 +355,12 @@ open class CardBrowser :
356355 if (viewModel.isInMultiSelectMode && viewModel.lastSelectedId != null ) {
357356 viewModel.selectRowsBetween(viewModel.lastSelectedId!! , id)
358357 } else {
359- launchCatchingTask {
360- val position = cardsAdapter.getPositionForId(id)
358+ val position = cardsAdapter.getPositionForId(id)
361359
362- lastSelectedPosition = position
363- saveScrollingState(position)
360+ lastSelectedPosition = position
361+ saveScrollingState(position)
364362
365- viewModel.toggleRowSelection(id)
366- }
363+ viewModel.toggleRowSelection(id)
367364 }
368365 }
369366
@@ -1921,9 +1918,8 @@ open class CardBrowser :
19211918 ): Intent = NoteEditorLauncher .AddNoteFromCardBrowser (viewModel).getIntent(context)
19221919 }
19231920
1924- private suspend fun saveScrollingState (position : Int ) {
1925- // Save the current card id and the top offset of the card
1926- oldCardId = viewModel.queryCardIdAtPosition(position)
1921+ private fun saveScrollingState (position : Int ) {
1922+ // Save the top offset of the card
19271923 oldCardTopOffset = viewModel.calculateTopOffset(cardsListView, position)
19281924 }
19291925
0 commit comments