Verified Commit 1a3a1659 authored by Sarath's avatar Sarath
Browse files

Fix : whirlpool mix errors not displaying

parent e5924107
......@@ -66,22 +66,11 @@ class MixDetailsBottomSheet : BottomSheetDialogFragment() {
binding.mixesDone.text = "${whirlpoolUtxo.mixsDone}"
try {
if (whirlpoolUtxo.utxoState != null && whirlpoolUtxo.utxoState.mixProgress != null) {
val mixProgress = whirlpoolUtxo.utxoState.mixProgress
binding.mixStepMessage.text = mixProgress.mixStep.message
binding.mixError.visibility = View.GONE
if (whirlpoolUtxo.utxoState.hasError()) {
binding.mixError.visibility = View.VISIBLE
binding.mixError.text = whirlpoolUtxo.utxoState.error
binding.mixProgressBar.setIndicatorColor(
ContextCompat.getColor(
requireContext(),
R.color.red
)
)
binding.mixProgressBar.setProgressCompat(20, true)
binding.mixMessage.text = whirlpoolUtxo.utxoState.message
} else {
if (whirlpoolUtxo.utxoState != null) {
if(whirlpoolUtxo.utxoState.mixProgress != null){
val mixProgress = whirlpoolUtxo.utxoState.mixProgress
binding.mixStepMessage.text = mixProgress.mixStep.message
binding.mixError.visibility = View.GONE
binding.mixProgressBar.setIndicatorColor(
ContextCompat.getColor(
requireContext(),
......@@ -94,11 +83,23 @@ class MixDetailsBottomSheet : BottomSheetDialogFragment() {
true
)
}
if (whirlpoolUtxo.utxoState.hasError()) {
binding.mixError.visibility = View.VISIBLE
binding.mixError.text = whirlpoolUtxo.utxoState.error
binding.mixProgressBar.setIndicatorColor(
ContextCompat.getColor(
requireContext(),
R.color.red
)
)
binding.mixProgressBar.setProgressCompat(20, true)
binding.mixStepMessage.text = getString(R.string.mix_error)
}
} else {
binding.mixProgressContainer.visibility = View.GONE
}
} catch (ex: Exception) {
binding.mixError.text = "${ex.message}"
}
}
......
......@@ -47,7 +47,9 @@ class MixListAdapter : RecyclerView.Adapter<MixListAdapter.ViewHolder>() {
}
viewBinding.mixStatus.text = "${utxo.mixsDone} ${viewBinding.root.context.getString(R.string.mixes_complete)}"
viewBinding.mixingButton.setIconTintResource(R.color.white)
if(utxoState.mixableStatus == MixableStatus.UNCONFIRMED ){
if(utxoState.hasError()){
viewBinding.mixStatus.text = "${utxoState.error}";
}else if(utxoState.mixableStatus == MixableStatus.UNCONFIRMED ){
viewBinding.mixingButton.setIconResource(R.drawable.ic_timer_white_24dp)
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment