Skip to content

Commit

Permalink
Fix merch distribution getting into the wrong error flow
Browse files Browse the repository at this point in the history
  • Loading branch information
evan10s committed Sep 8, 2024
1 parent 4e1b5a5 commit c3be6e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ class MerchandiseViewModel @Inject constructor(
}

fun dismissPickupDialog() {
error.value = null
screenState.value = MerchandiseDistributionScreenState.ReadyForTap
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.nxp.nfclib.NxpNfcLib
import org.robojackets.apiary.base.ui.error.ErrorMessageWithRetry
import org.robojackets.apiary.base.ui.util.ContentPadding
import org.robojackets.apiary.base.ui.util.LoadingSpinner
import org.robojackets.apiary.merchandise.model.MerchandiseDistributionScreenState
import org.robojackets.apiary.merchandise.model.MerchandiseViewModel
import timber.log.Timber

Expand All @@ -33,7 +34,7 @@ fun MerchandiseDistributionScreen(
prioritizeRetryButton = true,
)
}
state.error != null -> {
state.error != null && state.screenState == MerchandiseDistributionScreenState.ReadyForTap -> {
ErrorMessageWithRetry(
title = state.error ?: "Merchandise distribution is temporarily unavailable",
onRetry = { viewModel.selectMerchandiseItemForDistribution(merchandiseItemId) },
Expand Down

0 comments on commit c3be6e7

Please sign in to comment.