Fix stuck on error when activation failed due to disconnect

> Remove PatchStep.ERROR state
This commit is contained in:
jbr7rr 2024-01-21 19:38:15 +01:00 committed by Casper V. Kristensen
parent 194cecce16
commit 0e61114851
6 changed files with 0 additions and 7 deletions

View file

@ -15,7 +15,6 @@ enum class PatchStep {
ACTIVATE_COMPLETE,
RETRY_ACTIVATION,
RETRY_ACTIVATION_CONNECT,
ERROR,
CANCEL,
COMPLETE;
}

View file

@ -38,7 +38,6 @@ class MedtrumActivateFragment : MedtrumBaseFragment<FragmentMedtrumActivateBindi
MedtrumViewModel.SetupStep.ACTIVATED -> moveStep(PatchStep.ACTIVATE_COMPLETE)
MedtrumViewModel.SetupStep.ERROR -> {
moveStep(PatchStep.ERROR)
updateSetupStep(MedtrumViewModel.SetupStep.PRIMED) // Reset setup step
binding.textActivatingPump.text = rh.gs(R.string.activating_error)
binding.btnPositive.visibility = View.VISIBLE

View file

@ -43,7 +43,6 @@ class MedtrumActivity : MedtrumBaseActivity<ActivityMedtrumBinding>() {
PatchStep.ATTACH_PATCH -> setupViewFragment(MedtrumAttachPatchFragment.newInstance())
PatchStep.ACTIVATE -> setupViewFragment(MedtrumActivateFragment.newInstance())
PatchStep.ACTIVATE_COMPLETE -> setupViewFragment(MedtrumActivateCompleteFragment.newInstance())
PatchStep.ERROR -> Unit // Do nothing, let activity handle this
PatchStep.RETRY_ACTIVATION -> setupViewFragment(MedtrumRetryActivationFragment.newInstance())
PatchStep.RETRY_ACTIVATION_CONNECT -> setupViewFragment(MedtrumRetryActivationConnectFragment.newInstance())
PatchStep.START_DEACTIVATION -> setupViewFragment(MedtrumStartDeactivationFragment.newInstance())

View file

@ -38,7 +38,6 @@ class MedtrumDeactivatePatchFragment : MedtrumBaseFragment<FragmentMedtrumDeacti
}
MedtrumViewModel.SetupStep.ERROR -> {
moveStep(PatchStep.ERROR)
updateSetupStep(MedtrumViewModel.SetupStep.START_DEACTIVATION) // Reset setup step
binding.textDeactivatingPump.text = rh.gs(R.string.deactivating_error)
binding.btnNegative.visibility = View.VISIBLE

View file

@ -39,7 +39,6 @@ class MedtrumPrimingFragment : MedtrumBaseFragment<FragmentMedtrumPrimingBinding
MedtrumViewModel.SetupStep.PRIMED -> moveStep(PatchStep.PRIME_COMPLETE)
MedtrumViewModel.SetupStep.ERROR -> {
moveStep(PatchStep.ERROR)
updateSetupStep(MedtrumViewModel.SetupStep.FILLED) // Reset setup step
binding.textWaitForPriming.text = rh.gs(R.string.priming_error)
binding.btnNegative.visibility = View.VISIBLE

View file

@ -137,7 +137,6 @@ class MedtrumViewModel @Inject constructor(
PatchStep.CANCEL,
PatchStep.COMPLETE,
PatchStep.ACTIVATE_COMPLETE,
PatchStep.ERROR,
PatchStep.START_DEACTIVATION,
PatchStep.DEACTIVATE,
PatchStep.FORCE_DEACTIVATION,
@ -307,7 +306,6 @@ class MedtrumViewModel @Inject constructor(
PatchStep.COMPLETE,
PatchStep.FORCE_DEACTIVATION,
PatchStep.ERROR,
PatchStep.CANCEL -> _title.value
}