fix: refetch wallet data on mount

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2024-10-30 20:57:54 +08:00
parent 71fcf50d0f
commit 2d11eb2d92
2 changed files with 5 additions and 1 deletions
@@ -100,6 +100,7 @@ export const MyWalletSection = ({ className }: { className?: string }) => {
{BigInt(myWallet.powerToken || 0n)}
</Balance>
<Button
buttonClassName={tw`rounded-full`}
variant="ghost"
onClick={() => refreshMutation.mutate()}
disabled={refreshMutation.isPending}
+4 -1
View File
@@ -58,7 +58,10 @@ export const wallet = {
},
}
export const useWallet = () => useAuthQuery(wallet.get())
export const useWallet = () =>
useAuthQuery(wallet.get(), {
refetchOnMount: true,
})
export const useWalletTransactions = (query: Parameters<typeof wallet.transactions.get>[0] = {}) =>
useAuthQuery(wallet.transactions.get(query))