Skip to content

Commit

Permalink
fix: insert 0 back into stream prices for the vote token
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermendes committed Nov 14, 2024
1 parent afd93f7 commit d6f3912
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,19 @@ export const StakingProvider = ({
}, [streamDecimals, voteIndex, voteSupply, voteTotalBalance]);

const fetchStreamPrices = useCallback(async () => {
return getStreamPrices([
const streamPrices = await getStreamPrices([
'aurora-near',
...tokenStreams
.map((stream) => stream.coingeckoName)
.filter((name) => name !== 'vote'),
]);
}, [getStreamPrices, tokenStreams]);

// Insert 0 for the price of the vote token (which was filtered out above)
streamPrices.prices.splice(voteIndex, 0, 0);
streamPrices.marketCaps.splice(voteIndex, 0, 0);

return streamPrices;
}, [getStreamPrices, tokenStreams, voteIndex]);

const syncConnectedAccount = useCallback(async () => {
try {
Expand Down

0 comments on commit d6f3912

Please sign in to comment.