Skip to content

Commit

Permalink
fix: reset balances to zero instead of null
Browse files Browse the repository at this point in the history
  • Loading branch information
toniocodo committed Dec 22, 2022
1 parent f51e179 commit 2ab74dc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
1 change: 0 additions & 1 deletion libs/mstable/meta-vault/src/components/Position/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const PositionContent = () => {
? profitOrLoss.divPrecisely(mvDeposited).exact.mul(100)
: 0,
);

return (
<Stack direction="column">
<Typography variant="body2" color="text.secondary" mb={2}>
Expand Down
12 changes: 6 additions & 6 deletions libs/mstable/meta-vault/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ export const {
useEffect(() => {
setState(
produce((draft) => {
draft.mvBalance = null;
draft.mvBalanceInAsset = null;
draft.assetBalance = null;
draft.assetBalanceInShare = null;
draft.mvDeposited = null;
draft.profitOrLoss = null;
draft.mvBalance = BigDecimal.ZERO;
draft.mvBalanceInAsset = BigDecimal.ZERO;
draft.assetBalance = BigDecimal.ZERO;
draft.assetBalanceInShare = BigDecimal.ZERO;
draft.mvDeposited = BigDecimal.ZERO;
draft.profitOrLoss = BigDecimal.ZERO;
}),
);
}, [walletAddress]);
Expand Down
43 changes: 22 additions & 21 deletions libs/shared/ui/src/CountUp/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isNilOrEmpty } from '@frontend/shared-utils';
import { Typography } from '@mui/material';
import CountUpLib from 'react-countup';

Expand Down Expand Up @@ -36,27 +37,27 @@ export const CountUp = ({
<Typography {...rest}>
{prefix ? `${prefix} ` : ''}
<CountUpLib
{...(className && { className })}
{...(decimal && { decimal })}
{...(decimals && { decimals })}
{...(delay && { delay })}
{...(duration && { duration })}
{...(end && { end })}
{...(redraw && { redraw })}
{...(preserveValue && { preserveValue })}
{...(separator && { separator })}
{...(start && { start })}
{...(useEasing && { useEasing })}
{...(easingFn && { easingFn })}
{...(formattingFn && { formattingFn })}
{...(enableScrollSpy && { enableScrollSpy })}
{...(scrollSpyDelay && { scrollSpyDelay })}
{...(scrollSpyOnce && { scrollSpyOnce })}
{...(onEnd && { onEnd })}
{...(onStart && { onStart })}
{...(onPauseResume && { onPauseResume })}
{...(onReset && { onReset })}
{...(onUpdate && { onUpdate })}
{...(!isNilOrEmpty(className) && { className })}
{...(!isNilOrEmpty(decimal) && { decimal })}
{...(!isNilOrEmpty(decimals) && { decimals })}
{...(!isNilOrEmpty(delay) && { delay })}
{...(!isNilOrEmpty(duration) && { duration })}
{...(!isNilOrEmpty(end) && { end })}
{...(!isNilOrEmpty(redraw) && { redraw })}
{...(!isNilOrEmpty(preserveValue) && { preserveValue })}
{...(!isNilOrEmpty(separator) && { separator })}
{...(!isNilOrEmpty(start) && { start })}
{...(!isNilOrEmpty(useEasing) && { useEasing })}
{...(!isNilOrEmpty(easingFn) && { easingFn })}
{...(!isNilOrEmpty(formattingFn) && { formattingFn })}
{...(!isNilOrEmpty(enableScrollSpy) && { enableScrollSpy })}
{...(!isNilOrEmpty(scrollSpyDelay) && { scrollSpyDelay })}
{...(!isNilOrEmpty(scrollSpyOnce) && { scrollSpyOnce })}
{...(!isNilOrEmpty(onEnd) && { onEnd })}
{...(!isNilOrEmpty(onStart) && { onStart })}
{...(!isNilOrEmpty(onPauseResume) && { onPauseResume })}
{...(!isNilOrEmpty(onReset) && { onReset })}
{...(!isNilOrEmpty(onUpdate) && { onUpdate })}
/>
{suffix ? ` ${suffix}` : ''}
</Typography>
Expand Down

0 comments on commit 2ab74dc

Please sign in to comment.