Skip to content

Commit

Permalink
refactor: remove displayCard
Browse files Browse the repository at this point in the history
  • Loading branch information
BrayanDSO committed Jan 3, 2024
1 parent 7ec80d8 commit 039624f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ class PreviewerFragment : Fragment(), Toolbar.OnMenuItemClickListener {
override fun onStartTrackingTouch(slider: Slider) {}

override fun onStopTrackingTouch(slider: Slider) {
viewModel.launchCatching {
displayCard(value.toInt() - 1)
}
viewModel.currentIndex.tryEmit(slider.value.toInt() - 1)
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,6 @@ class PreviewerViewModel(private val selectedCardIds: LongArray, firstIndex: Int
return addPlayButtons(withCol { media.escapeMediaFilenames(text) })
}

suspend fun displayCard(index: Int) {
if (index !in 0..selectedCardIds.lastIndex) {
return
}
currentIndex.emit(index)
}

fun showPreviousCard() {
currentIndex.update { it - 1 }
}
Expand Down

0 comments on commit 039624f

Please sign in to comment.