From 2fa07bd263ee8c2c42f834b67a079024bc3eb1ee Mon Sep 17 00:00:00 2001 From: olekon Date: Sat, 31 Aug 2019 21:30:01 +0700 Subject: [PATCH] ErrorBoundary added to Center.jsx --- src/components/base/Center.jsx | 106 +++++++++++++++++---------------- 1 file changed, 55 insertions(+), 51 deletions(-) diff --git a/src/components/base/Center.jsx b/src/components/base/Center.jsx index a7f2062..11abeb2 100644 --- a/src/components/base/Center.jsx +++ b/src/components/base/Center.jsx @@ -5,6 +5,8 @@ import Deploy from '../contract/Deploy.jsx'; import LoadTransactionView from '../contract/LoadTransactionView.jsx'; import BroadcastTransactionView from '../contract/BroadcastTransactionView.jsx'; import NetworkSelect from '../settings/NetworkSelect.jsx'; +import ErrorBoundary from './ErrorBoundary.jsx'; + import * as contractLogic from '../../scripts/contractLogic.js'; import * as nodeLogic from '../../scripts/nodeLogic.js'; @@ -37,13 +39,13 @@ class Center extends React.Component { }); const networkId = nodeLogic.getNetworkId(nodeKey); - let contractList = contractLogic.getContractList(); - let contracts = contractList.filter(contract=>contract.networkId === networkId); + let contractList = contractLogic.getContractList(); + let contracts = contractList.filter(contract => contract.networkId === networkId); + - const activeContract = contracts.length > 0 ? contracts[0] : null; contractLogic.saveActiveContract(activeContract); - + } handleMenuClick(e) { @@ -92,53 +94,55 @@ class Center extends React.Component { const node = this.getNodeInfo(this.state.activeNodeKey); return ( <> - - - - - - - Browser - Deploy - Load Transaction - Broadcast Transaction - - - -
- {this.state.activeMenuKey === "browser" ? : null - } - {this.state.activeMenuKey === "deploy" ? : null - } - {this.state.activeMenuKey === "load" ? : null - } - {this.state.activeMenuKey === "broadcast" ? : null - } -
+ + + + + + + + Browser + Deploy + Load Transaction + Broadcast Transaction + + + +
+ {this.state.activeMenuKey === "browser" ? : null + } + {this.state.activeMenuKey === "deploy" ? : null + } + {this.state.activeMenuKey === "load" ? : null + } + {this.state.activeMenuKey === "broadcast" ? : null + } +
+
); }