Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
When on barn.cowswap.exchange, use barn.gnosis-procol.io (#1890)
Browse files Browse the repository at this point in the history
Co-authored-by: Leandro Boscariol <[email protected]>
  • Loading branch information
alfetopito and Leandro Boscariol authored Nov 19, 2021
1 parent 4956361 commit 161d8a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ REACT_APP_PATH_REGEX_ENS="/ipfs"
#REACT_APP_EXPLORER_URL_DEV=https://protocol-explorer.dev.gnosisdev.com
#REACT_APP_EXPLORER_URL_STAGING=https://protocol-explorer.staging.gnosisdev.com
#REACT_APP_EXPLORER_URL_PROD=https://gnosis-protocol.io
#REACT_APP_EXPLORER_URL_BARN=https://barn.gnosis-protocol.io

# Enables mock mode (default = true)
REACT_APP_MOCK=true
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ REACT_APP_PATH_REGEX_ENS="/ipfs"
#REACT_APP_EXPLORER_URL_DEV=https://protocol-explorer.dev.gnosisdev.com
#REACT_APP_EXPLORER_URL_STAGING=https://protocol-explorer.staging.gnosisdev.com
#REACT_APP_EXPLORER_URL_PROD=https://gnosis-protocol.io
#REACT_APP_EXPLORER_URL_BARN=https://barn.gnosis-protocol.io

# Enables mock mode (default = false)
REACT_APP_MOCK=false
4 changes: 3 additions & 1 deletion src/custom/utils/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { isLocal, isDev, isPr, isStaging, isBarn } from './environments'

function _getExplorerUrlByEnvironment() {
let baseUrl: string | undefined
if (isLocal || isDev || isPr || isBarn) {
if (isLocal || isDev || isPr) {
baseUrl = process.env.REACT_APP_EXPLORER_URL_DEV || 'https://protocol-explorer.dev.gnosisdev.com'
} else if (isStaging) {
baseUrl = process.env.REACT_APP_EXPLORER_URL_STAGING || 'https://protocol-explorer.staging.gnosisdev.com'
} else if (isBarn) {
baseUrl = process.env.REACT_APP_EXPLORER_URL_BARN || 'https://barn.gnosis-protocol.io'
} else {
// Production by default
baseUrl = process.env.REACT_APP_EXPLORER_URL_PROD || 'https://gnosis-protocol.io'
Expand Down

0 comments on commit 161d8a7

Please sign in to comment.