Skip to content

Commit

Permalink
fix: circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys committed Jun 27, 2024
1 parent 92f43d2 commit ad02a41
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/renderer/src/queries/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { defineQuery } from "@renderer/lib/defineQuery"
import { useMutation } from "@tanstack/react-query"
import { toast } from "sonner"

import { Queries } from "."

export const wallet = {
get: ({ userId }: { userId?: string } = {}) =>
defineQuery(
Expand Down Expand Up @@ -61,7 +59,7 @@ export const useCreateWalletMutation = () =>
toast.error(await getFetchErrorMessage(err))
},
onSuccess() {
Queries.wallet.get().invalidate()
wallet.get().invalidate()
toast("🎉 Wallet created.")
},
})
Expand All @@ -79,8 +77,8 @@ export const useClaimWalletDailyRewardMutation = () => useMutation({
toast.error(await getFetchErrorMessage(err))
},
onSuccess() {
Queries.wallet.get().invalidate()
Queries.wallet.claimDailyRewardTtl().invalidate()
wallet.get().invalidate()
wallet.claimDailyRewardTtl().invalidate()
toast("🎉 Daily reward claimed.")
},
})
Expand All @@ -93,8 +91,8 @@ export const useWalletTipMutation = () => useMutation({
toast.error(await getFetchErrorMessage(err))
},
onSuccess() {
Queries.wallet.get().invalidate()
Queries.wallet.transactions.get().invalidate()
wallet.get().invalidate()
wallet.transactions.get().invalidate()
toast("🎉 Tipped.")
},
})

0 comments on commit ad02a41

Please sign in to comment.