Skip to content

Commit

Permalink
review: Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Nov 13, 2024
1 parent 327581f commit 3e1f166
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.ui.TransferUi
import com.infomaniak.multiplatform_swisstransfer.common.models.TransferDirection
import com.infomaniak.swisstransfer.R
Expand All @@ -43,9 +44,13 @@ fun ReceivedScreen(
transfersViewModel: TransfersViewModel = hiltViewModel<TransfersViewModel>(),
) {

val getTransfers = { transfersViewModel.receivedTransfers.value }
val transfers by transfersViewModel.receivedTransfers.collectAsStateWithLifecycle()

ReceivedScreen(navigateToDetails, getSelectedTransferUuid, getTransfers)
ReceivedScreen(
navigateToDetails = navigateToDetails,
getSelectedTransferUuid = getSelectedTransferUuid,
getTransfers = { transfers },
)
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.ui.TransferUi
import com.infomaniak.multiplatform_swisstransfer.common.models.TransferDirection
import com.infomaniak.swisstransfer.ui.components.NewTransferFab
Expand All @@ -44,9 +45,13 @@ fun SentScreen(
transfersViewModel: TransfersViewModel = hiltViewModel<TransfersViewModel>(),
) {

val getTransfers = { transfersViewModel.sentTransfers.value }
val transfers by transfersViewModel.sentTransfers.collectAsStateWithLifecycle()

SentScreen(navigateToDetails, getSelectedTransferUuid, getTransfers)
SentScreen(
navigateToDetails = navigateToDetails,
getSelectedTransferUuid = getSelectedTransferUuid,
getTransfers = { transfers },
)
}

@Composable
Expand Down

0 comments on commit 3e1f166

Please sign in to comment.