fixed negative shares bug

This commit is contained in:
mantikoros 2022-05-02 12:16:29 -04:00
parent 6232284e92
commit 43d3662db1

View File

@ -26,10 +26,8 @@ export const useSaveShares = (
_.sumBy(noBets, (bet) => bet.shares),
]
const [yesFloorShares, noFloorShares] = [
Math.floor(yesShares),
Math.floor(noShares),
]
const yesFloorShares = Math.round(yesShares) === 0 ? 0 : Math.floor(yesShares)
const noFloorShares = Math.round(noShares) === 0 ? 0 : Math.floor(noShares)
useEffect(() => {
// Save yes and no shares to local storage.