diff --git a/src/App.js b/src/App.js index e306cc7..c210c50 100644 --- a/src/App.js +++ b/src/App.js @@ -102,7 +102,7 @@ function App() { } function chainsByPath() { - if (!chains) return {} + if (!chains?.chains) return {} return chains.chains.reduce((a, v) => ({ ...a, [v.path]: v }), {}) } diff --git a/src/components/AppHeader.js b/src/components/AppHeader.js index 65eaca5..7a561d8 100644 --- a/src/components/AppHeader.js +++ b/src/components/AppHeader.js @@ -42,7 +42,7 @@ const AppHeader = (props) => { command() { navigate('/') } } ] - if(!chains) return data + if(!chains?.chains) return data return chains.chains.reduce((sum, chain) => { data.push({ diff --git a/src/components/ConfigurationPanel.js b/src/components/ConfigurationPanel.js index e85ead8..e73d2ec 100644 --- a/src/components/ConfigurationPanel.js +++ b/src/components/ConfigurationPanel.js @@ -54,21 +54,30 @@ function ConfigurationPanel(props) { value: chain.codebase.compatible_versions.join(', ') }) - if(chain.daemon_name) data.push({ + const daemon_name = chain.codebase?.daemon_name || chain.daemon_name + if(daemon_name) data.push({ key: 'Daemon Name', - value: chain.daemon_name + value: daemon_name }) - if(chain.node_home) data.push({ + const node_home = chain.codebase?.node_home || chain.node_home + if(node_home) data.push({ key: 'Node Home', - value: chain.node_home + value: node_home }) - if(chain.genesis?.genesis_url){ - const url = chain.genesis?.genesis_url + const genesis_url = chain.codebase?.genesis?.genesis_url || chain.genesis?.genesis_url + if(genesis_url){ data.push({ key: 'Genesis URL', - value: {url} + value: {genesis_url} + }) + } + + if (chain.website) { + data.push({ + key: 'Website', + value: {chain.website} }) } diff --git a/src/components/OverviewPanel.js b/src/components/OverviewPanel.js index 70caf4e..8b07af1 100644 --- a/src/components/OverviewPanel.js +++ b/src/components/OverviewPanel.js @@ -43,6 +43,12 @@ function OverviewPanel(props) { value: status.available ? Available : Unavailable }, ]) + if(chain.website){ + data.push({ + key: 'Website', + value: {chain.website} + }) + } if(chain.explorers){ data.push({ key: 'Explorers', diff --git a/src/components/ValidatorBadges.js b/src/components/ValidatorBadges.js index fc23668..c4773c6 100644 --- a/src/components/ValidatorBadges.js +++ b/src/components/ValidatorBadges.js @@ -26,7 +26,7 @@ function ValidatorBadges(props) { } function commissionPercent() { - return validator.commission && validator.commission.commission_rates.rate + return validator.commission?.commission_rates?.rate } function renderBadge(icon, tooltip, check, link) {