diff --git a/components/BalanceReminder/index.tsx b/components/BalanceReminder/index.tsx index bcac8d0b..4d8d6460 100644 --- a/components/BalanceReminder/index.tsx +++ b/components/BalanceReminder/index.tsx @@ -22,11 +22,14 @@ const BalanceReminder = () => { ...accountSupplied.map((token) => ({ ...token, type: "main" })), ...accountSuppliedMEME.map((token) => ({ ...token, type: "meme" })), ]; + const [lastClosedDate, setLastClosedDate] = useState(() => + localStorage.getItem("balanceReminderLastClosed"), + ); + const Unreminded = useMemo(() => { - const lastClosedDate = localStorage.getItem("balanceReminderLastClosed"); const today = new Date().toDateString(); return !lastClosedDate || lastClosedDate !== today; - }, []); + }, [lastClosedDate]); const dispatch = useDispatch(); useEffect(() => { const hasValidAccountSupplied = @@ -54,6 +57,7 @@ const BalanceReminder = () => { function closeTip() { const today = new Date().toDateString(); localStorage.setItem("balanceReminderLastClosed", today); + setLastClosedDate(today); setShouldShow(false); } if (!shouldShow) { diff --git a/components/HashResultModal/ModalWithChangeCollateral.tsx b/components/HashResultModal/ModalWithChangeCollateral.tsx index 56226c81..d8b66de5 100644 --- a/components/HashResultModal/ModalWithChangeCollateral.tsx +++ b/components/HashResultModal/ModalWithChangeCollateral.tsx @@ -119,7 +119,7 @@ const ModalWithChangeCollateral = ({ */}
collateral({symbol}) - ${toInternationalCurrencySystem_number(Number(collateral))} + {toInternationalCurrencySystem_number(Number(collateral))}
{renderProgressBar()}
diff --git a/components/NonFarmedAssets/index.tsx b/components/NonFarmedAssets/index.tsx index 38819e54..b3b6eea0 100644 --- a/components/NonFarmedAssets/index.tsx +++ b/components/NonFarmedAssets/index.tsx @@ -1,8 +1,9 @@ import { BeatLoader } from "react-spinners"; -import { useNonFarmedAssets } from "../../hooks/hooks"; +import { useAccountId, useNonFarmedAssets } from "../../hooks/hooks"; import ClaimAllRewards from "../ClaimAllRewards"; function NonFarmedAssets() { + const accountId = useAccountId(); const { hasNonFarmedAssets, hasNegativeNetLiquidity } = useNonFarmedAssets(false); const { hasNonFarmedAssets: hasNonFarmedAssetsMEME, @@ -10,7 +11,9 @@ function NonFarmedAssets() { } = useNonFarmedAssets(true); const main_null = !hasNonFarmedAssets || hasNegativeNetLiquidity; const meme_null = !hasNonFarmedAssetsMEME || hasNegativeNetLiquidityMEME; - + if (!accountId) { + return null; + } if (!main_null) { return (
@@ -18,7 +21,7 @@ function NonFarmedAssets() {
At least one of your farms in the Mainstream has started emitting extra rewards. If you - are seeing this warning, please click ‘Claim & Join’ to join the new farm. + are seeing this warning, please click 'Claim & Join' to join the new farm.
At least one of your farms in the meme has started emitting extra rewards. If you are - seeing this warning, please click ‘Claim & Join’ to join the new farm. + seeing this warning, please click 'Claim & Join' to join the new farm.
{ const accountId = useAccountId(); const { activeCategory } = useAppSelector((state) => state.category); const { toastMessage, showToast } = useToastMessage(); - const assets = useAppSelector(getAssetsCategory(false)); const isMeme = useAppSelector(isMemeCategory); + const assets = useAppSelector(getAssetsCategory(isMeme)); const [isLoading, setIsLoading] = useState(false); const [docs, setDocs] = useState([]); const [pagination, setPagination] = useState<{ diff --git a/screens/MarginTrading/components/MyTrading/MyTradingPage.tsx b/screens/MarginTrading/components/MyTrading/MyTradingPage.tsx index a8330f23..58926f87 100644 --- a/screens/MarginTrading/components/MyTrading/MyTradingPage.tsx +++ b/screens/MarginTrading/components/MyTrading/MyTradingPage.tsx @@ -190,7 +190,7 @@ const MyMarginTradingPage = () => { return Object.entries(mergedCollateral).map(([tokenId, data], index) => (
- +

{data.symbol}

{beautifyPrice(data.totalValue, true)} @@ -280,7 +280,7 @@ const MyMarginTradingPage = () => { return Object.entries(mergedCollateral).map(([tokenId, data], index) => (
- +

{data.symbol}

{beautifyPrice(data.totalValue, true)} diff --git a/screens/Trading/components/ChangeCollateralMobile.tsx b/screens/Trading/components/ChangeCollateralMobile.tsx index 1de36ecb..c9ec75bc 100644 --- a/screens/Trading/components/ChangeCollateralMobile.tsx +++ b/screens/Trading/components/ChangeCollateralMobile.tsx @@ -250,7 +250,7 @@ const ChangeCollateralMobile: FC = ({ open, onClose positionType: positionType.label, icon: iconC, symbol: symbolC, - addedValue: String(addedValue), + addedValue: String(addedValue / priceC), }; localStorage.setItem("marginTradingTab", "my"); localStorage.setItem("marginTransactionType", "changeCollateral"); @@ -262,7 +262,7 @@ const ChangeCollateralMobile: FC = ({ open, onClose icon: iconC, type: positionType.label === "Long" ? "Long" : "Short", symbol: symbolC, - collateral: String(addedValue), + collateral: String(addedValue / priceC), }); } } catch (error) { @@ -283,7 +283,7 @@ const ChangeCollateralMobile: FC = ({ open, onClose positionType: positionType.label, icon: iconC, symbol: symbolC, - addedValue: String(addedValue), + addedValue: String(addedValue / priceC), }; dispatch(setActiveTab("my")); localStorage.setItem("marginTransactionType", "changeCollateral"); @@ -295,7 +295,7 @@ const ChangeCollateralMobile: FC = ({ open, onClose type: positionType.label === "Long" ? "Long" : "Short", icon: iconC, symbol: symbolC, - collateral: String(addedValue), + collateral: String(addedValue / priceC), }); } } catch (error) {