Skip to content

Commit

Permalink
Replaced config based check with sdk store variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitkarna99 committed Dec 11, 2023
1 parent 867ae07 commit cc61fbb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SUBGRAPH_API_URLS } from '@/src/config/constants'
import { ChainConfig } from '@/src/config/hardcoded'
import { detectChainId } from '@/utils/dns'
import { config } from '@neptunemutual/sdk'

export const getNetworkId = () => {
const host = window.location.host
Expand All @@ -12,7 +12,13 @@ export const getNetworkId = () => {
export const getGraphURL = (networkId) => { return SUBGRAPH_API_URLS[networkId] || null }

export const isFeatureEnabled = (feature) => {
const bridgeOnly = !ChainConfig[Number(process.env.NEXT_PUBLIC_FALLBACK_NETWORK)]
let bridgeOnly = false

try {
config.store.getStoreAddressFromEnvironment(Number(process.env.NEXT_PUBLIC_FALLBACK_NETWORK))
} catch (err) {
bridgeOnly = true
}

const str = bridgeOnly
? 'bridge-layerzero'
Expand Down

0 comments on commit cc61fbb

Please sign in to comment.