Skip to content

Commit

Permalink
Fix UIA for 0-precision tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Nov 25, 2024
1 parent f3d1810 commit 7e997b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/redux/FetchDataSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ export function* fetchState(location_change_action) {
const my_assets = yield call([api, api.getAssetsAsync], '', [], '', 5000)
my_assets.forEach(ma => {
const sym = ma.supply.split(' ')[1]
const precision = ma.supply.split(' ')[0].split('.')[1].length
const fract = ma.supply.split(' ')[0].split('.')
const precision = fract[1] ? fract[1].length : 0

if (sym in state.assets) {
state.assets[sym].my = true
} else {
const zero = (precision ? '0.' : '0') + '0'.repeat(precision) + ' ' + sym
state.assets[sym] = {
balance: '0.' + '0'.repeat(precision) + ' ' + sym,
tip_balance: '0.' + '0'.repeat(precision) + ' ' + sym,
market_balance: '0.' + '0'.repeat(precision) + ' ' + sym
balance: zero,
tip_balance: zero,
market_balance: zero
}
}

Expand Down

0 comments on commit 7e997b4

Please sign in to comment.