Skip to content

Commit

Permalink
chore: added TAO apy placeholder fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
UrbanWill committed Sep 20, 2024
1 parent 162ea79 commit 7a13ebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/portal/src/domains/staking/subtensor/hooks/useApr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ export const useApr = (genesisHash: string | undefined) => {
return useAtomValue(stakingAprByChainAtomFamily(genesisHash))
}

const TAO_APY_PLACEHOLDER = '~16%'

export const useAprFormatted = (genesisHash: string | undefined) => {
const apr = useApr(genesisHash)

return apr ? apr.toLocaleString(undefined, { style: 'percent', maximumFractionDigits: 2 }) : '--'
return apr ? apr.toLocaleString(undefined, { style: 'percent', maximumFractionDigits: 2 }) : TAO_APY_PLACEHOLDER
}
3 changes: 3 additions & 0 deletions apps/portal/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ export default defineConfig({
'@': path.resolve(__dirname, './src'),
},
},
optimizeDeps: {
exclude: ['threads/worker'],
},
})

0 comments on commit 7a13ebc

Please sign in to comment.