Skip to content

Commit

Permalink
Merge pull request #294 from aura-nw/euphoria
Browse files Browse the repository at this point in the history
add env
  • Loading branch information
harisato authored Jul 25, 2023
2 parents 9aa484b + 3415708 commit 0c23191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/layout/Root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Sentry from '@sentry/react'
import { useEffect, useState } from 'react'

import { MuiThemeProvider } from '@material-ui/core/styles'
import { Provider } from 'react-redux'
import { Provider, useDispatch } from 'react-redux'
import { Router } from 'react-router'
import App from 'src/App'
import GlobalErrorBoundary from 'src/components/GlobalErrorBoundary'
Expand All @@ -30,6 +30,7 @@ import './KeystoneCustom.module.scss'
import LegacyRouteRedirection from './LegacyRouteRedirection'
import './OnboardCustom.module.scss'
import { pyxisTheme } from 'src/theme/styledComponentsTheme'
import { setEnvironmentAction } from 'src/logic/config/store/actions'
// Preloader is rendered outside of '#root' and acts as a loading spinner
// for the app and then chains loading
const removePreloader = () => {
Expand All @@ -40,6 +41,7 @@ const RootConsumer = (): React.ReactElement | null => {
const [gatewayUrl, setGatewayUrl] = useState<string>('')
const [hasChains, setHasChains] = useState<boolean>(false)
const [isError, setIsError] = useState<boolean>(false)
const dispatch = useDispatch()

useEffect(() => {
const initGateway = async () => {
Expand All @@ -60,6 +62,7 @@ const RootConsumer = (): React.ReactElement | null => {
if (apiGateway) {
setBaseUrl(apiGateway)
setEnv(env || 'development')
dispatch(setEnvironmentAction((env || 'development') as 'production' | 'development'))
setGithubPageTokenRegistryUrl(`https://aura-nw.github.io/token-registry/${chainId}.json`)
setGatewayUrl(apiGateway)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/logic/config/store/reducer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const CONFIG_REDUCER_ID = LOCAL_CONFIG_KEY

export const initialConfigState: ConfigState = {
chainId: _getChainId(),
environment: 'development',
environment: 'production',
}

// Stored locally as to preserve chainId for non-EIP-3770 routes
Expand Down

0 comments on commit 0c23191

Please sign in to comment.