Skip to content

Commit

Permalink
fix: correctly deserialize bignumber
Browse files Browse the repository at this point in the history
  • Loading branch information
aramalipoor committed Oct 2, 2022
1 parent a74b9d5 commit 65b990a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/react/src/common/providers/CommonProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { persistQueryClient } from '@tanstack/react-query-persist-client';
import { deserialize, serialize } from 'wagmi';

const localStoragePersister =
typeof window !== 'undefined'
? createSyncStoragePersister({
key: 'flair.cache',
storage: window.localStorage,
serialize,
deserialize,
})
: undefined;

Expand All @@ -15,7 +18,7 @@ const queryClient = new QueryClient({
queries: {
cacheTime: 1_000 * 60 * 60 * 24,
staleTime: 1_000 * 60 * 60 * 2,
// networkMode: 'offlineFirst',
networkMode: 'offlineFirst',
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false,
Expand Down
6 changes: 4 additions & 2 deletions packages/react/src/modules/tiered-sales/hooks/useSaleTiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ export const useSaleTiers = ({
isActive,
hasAllowlist,
isAllowlisted,
eligibleAmount,
remainingSupply,
eligibleAmount: eligibleAmount ? eligibleAmount.toString() : undefined,
remainingSupply: remainingSupply
? remainingSupply.toString()
: undefined,
isEligible:
eligibleAmount !== undefined
? BigNumber.from(eligibleAmount).gt(0)
Expand Down

0 comments on commit 65b990a

Please sign in to comment.