Skip to content

Commit

Permalink
nuke bad import
Browse files Browse the repository at this point in the history
  • Loading branch information
aeolianeth committed Sep 19, 2024
1 parent 9ee0712 commit 9971c59
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/lib/apollo/subgraphUri.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { JBChainId } from 'juice-sdk-react'
import process from 'process'
import { isBrowser } from 'utils/isBrowser'
import { sepolia } from 'viem/chains'

Expand Down Expand Up @@ -32,25 +31,25 @@ export const v4SubgraphUri = (chainId: JBChainId) => {

const env: {
[k in JBChainId]?: {
browser?: string
server?: string
browserUrl?: string
serverUrl?: string
}
} = {
[sepolia.id]: {
browser: process.env.NEXT_PUBLIC_V4_SEPOLIA_SUBGRAPH_URL,
server: process.env.V4_SEPOLIA_SUBGRAPH_URL,
browserUrl: process.env.NEXT_PUBLIC_V4_SEPOLIA_SUBGRAPH_URL,
serverUrl: process.env.V4_SEPOLIA_SUBGRAPH_URL,
},
} as const

if (isBrowser()) {
uri = env?.[chainId]?.browser
uri = env?.[chainId]?.browserUrl
if (!uri) {
throw new Error(
'NEXT_PUBLIC_V4_SUBGRAPH_URL environment variable not defined',
)
}
} else {
uri = env?.[chainId]?.server
uri = env?.[chainId]?.serverUrl
if (!uri) {
throw new Error('V4_SUBGRAPH_URL environment variable not defined')
}
Expand Down

0 comments on commit 9971c59

Please sign in to comment.