@@ -26,9 +26,7 @@ import { toast } from "sonner"
2626import { z } from "zod"
2727
2828import { useModalStack } from "~/components/ui/modal/stacked/hooks"
29- import { useAuthQuery } from "~/hooks/common/useBizQuery"
3029import { followClient } from "~/lib/api-client"
31- import { defineQuery } from "~/lib/defineQuery"
3230import { useTOTPModalWrapper } from "~/modules/profile/hooks"
3331import { Balance } from "~/modules/wallet/balance"
3432import { useWallet , wallet as walletActions } from "~/queries/wallet"
@@ -67,12 +65,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
6765 resolver : zodResolver ( formSchema ) ,
6866 } )
6967
70- const powerPrice = useAuthQuery (
71- defineQuery ( [ "power-price" ] , async ( ) => {
72- const res = await followClient . api . wallets . powerPrice ( )
73- return res . data
74- } ) ,
75- )
68+ const rss3ConversionRate : number | null = null
7669
7770 const mutation = useMutation ( {
7871 mutationFn : async ( {
@@ -105,7 +98,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
10598 if ( mutation . isError ) {
10699 toast . error ( t ( "wallet.withdraw.error" , { error : mutation . error ?. message } ) )
107100 }
108- } , [ mutation . isError , t ] )
101+ } , [ mutation . error ?. message , mutation . isError , t ] )
109102
110103 useEffect ( ( ) => {
111104 if ( mutation . isSuccess ) {
@@ -180,7 +173,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
180173 < TooltipPortal >
181174 < TooltipContent >
182175 < span className = "text-xs text-gray-500" >
183- 1 POWER = { powerPrice . data ?. rss3 ?? "-" } RSS3
176+ < span > 1 POWER = { rss3ConversionRate ?? "-" } RSS3</ span >
184177 </ span >
185178 </ TooltipContent >
186179 </ TooltipPortal >
@@ -192,12 +185,10 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
192185 </ span >
193186 </ FormControl >
194187 </ div >
195- { field . value && (
188+ { field . value && rss3ConversionRate !== null && (
196189 < span className = "text-xs text-gray-500" >
197190 { t ( "wallet.withdraw.receiveRSS3" , {
198- amount : ( ( form . watch ( "amount" ) || 0 ) * ( powerPrice . data ?. rss3 ?? 0 ) ) . toFixed (
199- 4 ,
200- ) ,
191+ amount : ( ( form . watch ( "amount" ) || 0 ) * rss3ConversionRate ) . toFixed ( 4 ) ,
201192 } ) }
202193 </ span >
203194 ) }
0 commit comments