Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
compose-stability errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shamim-emon committed Sep 18, 2024
1 parent 53c9a80 commit 6fceb5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.ivy.loans.loan

import androidx.compose.runtime.Immutable

@Immutable
sealed interface LoanScreenMode {
data object TabularMode : LoanScreenMode
data object NonTabularMode : LoanScreenMode
Expand Down
8 changes: 4 additions & 4 deletions screen/loans/src/main/java/com/ivy/loans/loan/LoansScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private fun BoxWithConstraintsScope.UI(

Spacer(Modifier.height(8.dp))

val scrollState = getLoansListState(state.screenMode, state.selectedTab)
val scrollState = getLoansListState(state)

if (state.screenMode == LoanScreenMode.TabularMode) {
val loans = if (state.selectedTab == LoanTab.PENDING) {
Expand Down Expand Up @@ -236,10 +236,10 @@ private fun BoxWithConstraintsScope.UI(
}

@Composable
private fun getLoansListState(screenMode: LoanScreenMode, selectedTab: LoanTab): LazyListState {
return when (screenMode) {
private fun getLoansListState(state: LoanScreenState): LazyListState {
return when (state.screenMode) {
LoanScreenMode.TabularMode -> {
if (selectedTab == LoanTab.PENDING) {
if (state.selectedTab == LoanTab.PENDING) {
rememberScrollPositionListState(
key = "loans_pending_lazy_column",
initialFirstVisibleItemIndex = ivyWalletCtx()
Expand Down

0 comments on commit 6fceb5b

Please sign in to comment.