Skip to content

Commit

Permalink
Fix default asset symbol in overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
apporc committed Oct 24, 2024
1 parent 002813d commit 0cba49a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
const { data } = $props();
const networkName = String(data.network);
let staked: Asset = $derived(
context.account ? getStakedBalance(data.network, context.account) : Asset.from(0, '0,UNKNOWN')
);
let staked: Asset = $derived(getStakedBalance(data.network, context.account));
let unstaking: Array<UnstakingRecord> = $derived(
context.account ? getUnstakingBalances(data.network, context.account) : []
);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[network]/(account)/(staking)/staking/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function getStakableBalance(network: NetworkState, account: AccountState)
return Asset.fromUnits(balance, network.chain.systemToken!.symbol);
}

export function getStakedBalance(network: NetworkState, account: AccountState): Asset {
export function getStakedBalance(network: NetworkState, account?: AccountState): Asset {
const staked = Int64.from(0);
if (account && account.loaded) {
if (account.account?.data.rex_info) {
Expand Down

0 comments on commit 0cba49a

Please sign in to comment.