-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Things left to do - [ ] Fix balance formating - [ ] Fix toasts and texts - [ ] Check if claimed / Limit claims - [ ] Show TX status (success, waiting, fail) (I clearly have issues with my env, got biome installed but not formatting according to config)
- Loading branch information
Showing
6 changed files
with
221 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { MutationCache, QueryClient } from "@tanstack/svelte-query" | ||
import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister" | ||
import { browser } from "$app/environment" | ||
|
||
export function createQueryClient() { | ||
const queryClient: QueryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
enabled: browser, | ||
gcTime: 1000 * 60 * 60 * 24, | ||
refetchOnReconnect: () => !queryClient.isMutating() | ||
} | ||
}, | ||
mutationCache: new MutationCache({ | ||
onSettled: () => { | ||
if (queryClient.isMutating() === 1) { | ||
return queryClient.invalidateQueries() | ||
} | ||
} | ||
}) | ||
}) | ||
|
||
const localStoragePersister = createSyncStoragePersister({ | ||
key: "SVELTE_QUERY", | ||
storage: typeof window !== "undefined" ? window.localStorage : undefined // Use local storage if in browser | ||
}) | ||
|
||
return { queryClient, localStoragePersister } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const faucetUnoMutation = ` | ||
mutation FaucetUnoMutation($address: Address!) { | ||
faucet { | ||
send(input: {toAddress: $address}) | ||
} | ||
}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.