From 41ad5758c5c32f916764f7e89fddc2e99bec6b70 Mon Sep 17 00:00:00 2001 From: GSaphal Date: Sun, 3 Mar 2024 12:19:45 -0500 Subject: [PATCH] (fix) unstaking fixed --- src/app/components/forms/stake/unstake/index.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/components/forms/stake/unstake/index.tsx b/src/app/components/forms/stake/unstake/index.tsx index cdd91d6..f7c76bf 100644 --- a/src/app/components/forms/stake/unstake/index.tsx +++ b/src/app/components/forms/stake/unstake/index.tsx @@ -10,9 +10,9 @@ import { useGetBalanceQuery } from "@/store/api/statsApi" const UnstakingForm = ({ validator, - callback + callback, }: { - validator: ValidatorType | undefined, + validator: ValidatorType | undefined callback?: () => void }) => { const { @@ -62,7 +62,14 @@ const UnstakingForm = ({ e.preventDefault() setValue( "stakeAmount", - formatTokenPrice({ amount: Number(balanceData?.stakes.find(item => item.validator.key === validator?.key).amount), precision: 9 }), + formatTokenPrice({ + amount: Number( + balanceData?.stakes?.find( + (item) => item.validator.key === validator?.key, + )?.amount, + ), + precision: 9, + }), ) }} /> @@ -73,7 +80,7 @@ const UnstakingForm = ({ size="large" variant="primary" className="w-full justify-center" - onClick={() => { }} + onClick={() => {}} > Unstake $COMAI