Skip to content

Commit

Permalink
fix: slide to playing list after registering session of a non-playing…
Browse files Browse the repository at this point in the history
… game
  • Loading branch information
croumy committed Sep 28, 2023
1 parent c18e16c commit 88a98c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ fun HomeScreen(
viewModel.getGames()
navController.currentBackStackEntry?.savedStateHandle?.set(Constants.HOME_NEED_REFRESH, false)
// SCROLL TO PLAYING LIST
horizontalScrollState.scrollToItem(1)
horizontalScrollState.scrollToItem(2)
//AND SCROLL TO GAME ITEM
val gameIndex = viewModel.gamesByCategories[Category.Playing]?.indexOfFirst { it.game_id == previousGameId?.value }
viewModel.currentListState.value = viewModel.listStates[1]
viewModel.currentListState.value = viewModel.listStates[2]
viewModel.currentListState.value.scrollToItem(gameIndex ?: 0)
navController.currentBackStackEntry?.savedStateHandle?.set(Constants.HOME_PREVIOUS_GAME_ID, null)
}
Expand Down

0 comments on commit 88a98c5

Please sign in to comment.