Skip to content

Commit

Permalink
fix(webapp): catch the error when parsing of endpoints fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Aug 29, 2023
1 parent e2bc6e4 commit 0c65321
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webapp/src/config/evm.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { eosConfig } from 'config'

let _avgBlockTime = 'N/A'
let _endpoints

switch (eosConfig.networkName) {
case 'telos-testnet':
Expand All @@ -15,9 +16,16 @@ switch (eosConfig.networkName) {
break
}

try {
_endpoints = JSON.parse(process.env.REACT_APP_EVM_ENDPOINTS || '[]') || []
} catch (error) {
console.error(error)
_endpoints = []
}

export const avgBlockTime = _avgBlockTime
export const maxTPSDataSize = 30 / _avgBlockTime || 0
export const account = 'eosio.evm'
export const endpoint = process.env.REACT_APP_EVM_ENDPOINT
export const blockExplorerUrl = process.env.REACT_APP_EVM_BLOCK_EXPLORER_URL
export const endpoints = JSON.parse(process.env.REACT_APP_EVM_ENDPOINTS || '[]') || []
export const endpoints = _endpoints

0 comments on commit 0c65321

Please sign in to comment.