[#332] Fix crash on balance details screen

Because the string format is expecting a number, the BlockHeight object needs to be unwrapped
This commit is contained in:
Carter Jernigan 2022-07-30 15:01:42 -04:00 committed by GitHub
parent 23b78c277b
commit 3300f9d9e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ class BalanceDetailFragment : BaseFragment<FragmentBalanceDetailBinding>() {
binding.textStatus.text = status.toStatus()
if (status.missingBlocks > 100) {
binding.textBlockHeightPrefix.text = "Processing "
binding.textBlockHeight.text = String.format("%,d", status.info.lastScannedHeight) + " of " + String.format("%,d", status.info.networkBlockHeight)
binding.textBlockHeight.text = String.format("%,d", status.info.lastScannedHeight?.value ?: 0) + " of " + String.format("%,d", status.info.networkBlockHeight?.value ?: 0)
} else {
status.info.lastScannedHeight.let { height ->
if (height == null) {
@ -133,7 +133,7 @@ class BalanceDetailFragment : BaseFragment<FragmentBalanceDetailBinding>() {
binding.textBlockHeight.text = ""
} else {
binding.textBlockHeightPrefix.text = "Balances as of block "
binding.textBlockHeight.text = String.format("%,d", status.info.lastScannedHeight)
binding.textBlockHeight.text = String.format("%,d", status.info.lastScannedHeight?.value ?: 0)
sendNewBlockSignal(status.info.lastScannedHeight)
}
}