Skip to content

Commit

Permalink
passed dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed May 17, 2024
1 parent 3b2c5c6 commit 16ed5cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const wagmiConfig = createConfig({
})

export const kitConfig: KitConfig = {
isDev: isDebugMode,
projectAccessKey,
defaultTheme: 'dark',
signIn: {
Expand Down
9 changes: 5 additions & 4 deletions packages/kit/src/hooks/useIndexerClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SequenceIndexer } from '@0xsequence/indexer'
import { ChainId, indexerURL, networks } from '@0xsequence/network'
import { ChainId, networks } from '@0xsequence/network'
import { useMemo } from 'react'

import { useProjectAccessKey } from './useProjectAccessKey'
Expand All @@ -13,11 +13,12 @@ export const useIndexerClient = (chainId: ChainId) => {

const indexerClients = useMemo(() => {
return new Map<ChainId, SequenceIndexer>()
}, [projectAccessKey])
}, [projectAccessKey, isDev])

const network = networks[chainId]
const clientUrl = isDev ? `https://dev-${network.name}-indexer.sequence.app` : `https://${network.name}-indexer.sequence.app`


if (!indexerClients.has(chainId)) {
indexerClients.set(chainId, new SequenceIndexer(clientUrl, projectAccessKey))
}
Expand All @@ -34,11 +35,11 @@ export const useIndexerClient = (chainId: ChainId) => {
export const useIndexerClients = (chainIds: ChainId[]) => {
const projectAccessKey = useProjectAccessKey()

const { isDev = false } = useKitConfig()
const { isDev = false, ...rest } = useKitConfig()

const indexerClients = useMemo(() => {
return new Map<ChainId, SequenceIndexer>()
}, [projectAccessKey])
}, [projectAccessKey, isDev])

const result = new Map<ChainId, SequenceIndexer>()

Expand Down

0 comments on commit 16ed5cd

Please sign in to comment.