Skip to content

Commit

Permalink
Rename isFlowController to canShowWalletsInline. (#9666)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaynewstrom-stripe authored Nov 19, 2024
1 parent dcb4edb commit 3c441cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal class DefaultPaymentMethodVerticalLayoutInteractor(
private val onEditPaymentMethod: (DisplayableSavedPaymentMethod) -> Unit,
private val onSelectSavedPaymentMethod: (PaymentMethod) -> Unit,
private val walletsState: StateFlow<WalletsState?>,
private val isFlowController: Boolean,
private val canShowWalletsInline: Boolean,
private val onMandateTextUpdated: (ResolvableString?) -> Unit,
private val updateSelection: (PaymentSelection?) -> Unit,
private val isCurrentScreen: StateFlow<Boolean>,
Expand Down Expand Up @@ -162,7 +162,7 @@ internal class DefaultPaymentMethodVerticalLayoutInteractor(
},
onUpdatePaymentMethod = { viewModel.savedPaymentMethodMutator.updatePaymentMethod(it) },
walletsState = viewModel.walletsState,
isFlowController = !viewModel.isCompleteFlow,
canShowWalletsInline = !viewModel.isCompleteFlow,
updateSelection = viewModel::updateSelection,
isCurrentScreen = viewModel.navigationHandler.currentScreen.mapAsStateFlow {
it is PaymentSheetScreen.VerticalMode
Expand Down Expand Up @@ -319,7 +319,7 @@ internal class DefaultPaymentMethodVerticalLayoutInteractor(
}

private fun showsWalletsInline(walletsState: WalletsState?): Boolean {
return isFlowController && walletsState != null && walletsState.googlePay != null
return canShowWalletsInline && walletsState != null && walletsState.googlePay != null
}

private fun getDisplayedSavedPaymentMethod(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
paymentMethodTypes = listOf("card", "cashapp")
)
),
isFlowController = false,
canShowWalletsInline = false,
) {
walletsState.value = WalletsState(
link = WalletsState.Link("email@email.com"),
Expand Down Expand Up @@ -481,7 +481,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
paymentMethodTypes = listOf("card", "cashapp")
)
),
isFlowController = true,
canShowWalletsInline = true,
) {
walletsState.value = WalletsState(
link = WalletsState.Link("email@email.com"),
Expand Down Expand Up @@ -515,7 +515,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
paymentMethodTypes = listOf("card", "cashapp")
)
),
isFlowController = true,
canShowWalletsInline = true,
updateSelection = { selectedWallet = it },
) {
walletsState.value = WalletsState(
Expand Down Expand Up @@ -547,7 +547,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
paymentMethodTypes = listOf("card", "cashapp")
)
),
isFlowController = true,
canShowWalletsInline = true,
) {
walletsState.value = WalletsState(
link = WalletsState.Link("email@email.com"),
Expand Down Expand Up @@ -575,7 +575,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
paymentMethodTypes = listOf("card", "cashapp")
)
),
isFlowController = true,
canShowWalletsInline = true,
) {
walletsState.value = WalletsState(
link = null,
Expand Down Expand Up @@ -988,7 +988,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
onEditPaymentMethod: (DisplayableSavedPaymentMethod) -> Unit = { notImplemented() },
onSelectSavedPaymentMethod: (PaymentMethod) -> Unit = { notImplemented() },
onUpdatePaymentMethod: (DisplayableSavedPaymentMethod) -> Unit = { notImplemented() },
isFlowController: Boolean = false,
canShowWalletsInline: Boolean = false,
updateSelection: (PaymentSelection?) -> Unit = { notImplemented() },
onMandateTextUpdated: (ResolvableString?) -> Unit = { notImplemented() },
reportPaymentMethodTypeSelected: (PaymentMethodCode) -> Unit = { notImplemented() },
Expand Down Expand Up @@ -1021,7 +1021,7 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
onEditPaymentMethod = onEditPaymentMethod,
onSelectSavedPaymentMethod = onSelectSavedPaymentMethod,
walletsState = walletsState,
isFlowController = isFlowController,
canShowWalletsInline = canShowWalletsInline,
onMandateTextUpdated = onMandateTextUpdated,
updateSelection = { paymentSelection ->
selection.value = paymentSelection
Expand Down

0 comments on commit 3c441cb

Please sign in to comment.