Skip to content

Commit

Permalink
Reuse variable that coerces page to not be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
mtotschnig committed Aug 24, 2023
1 parent e8448b8 commit de054a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ abstract class BaseMyExpenses : LaunchActivity(), OcrHost, OnDialogResultListene
toolbar.subtitle = null
}
}
val pagerState = remember { PagerState(initialPage = accountData.indexOfFirst { it.id == selectedAccountId }) }
val pagerState = remember { PagerState(initialPage = currentPage) }
if (accountData.isNotEmpty()) {
LaunchedEffect(viewModel.selectedAccountId) {
if (pagerState.currentPage != currentPage) {
Expand Down

0 comments on commit de054a7

Please sign in to comment.