Skip to content

Commit 802008b

Browse files
committed
chore(flipcash): update pending state for purchases to show button text
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 9ad9858 commit 802008b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/flipcash/features/purchase/src/main/kotlin/com/flipcash/app/purchase/internal/PurchaseAccountScreenContent.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import com.getcode.ui.theme.CodeCircularProgressIndicator
3939
import com.getcode.ui.theme.CodeScaffold
4040
import com.getcode.util.getActivity
4141
import com.getcode.util.permissions.LocalPermissionChecker
42+
import com.getcode.view.LoadingSuccessState
4243
import kotlinx.coroutines.flow.filterIsInstance
4344
import kotlinx.coroutines.flow.launchIn
4445
import kotlinx.coroutines.flow.onEach
@@ -94,7 +95,7 @@ private fun PurchaseAccountScreenContent(
9495
.fillMaxWidth(),
9596
buttonState = ButtonState.Filled,
9697
enabled = state.hasProduct && !state.isPurchasePending,
97-
isLoading = state.creatingAccount.loading,
98+
isLoading = state.creatingAccount.loading && !state.isPurchasePending,
9899
isSuccess = state.creatingAccount.success,
99100
text = if (state.isPurchasePending) {
100101
stringResource(R.string.title_purchaseAccountPending)
@@ -206,7 +207,8 @@ private fun Preview_Pending() {
206207
currency = CurrencyCode.USD
207208
),
208209
formattedCost = "$20",
209-
isPurchasePending = true
210+
isPurchasePending = true,
211+
creatingAccount = LoadingSuccessState(loading = true)
210212
),
211213
) { }
212214
}

0 commit comments

Comments
 (0)