From 9b37dfd96df8b707d81ee7a7f4f9c33ab7d7c2e8 Mon Sep 17 00:00:00 2001 From: shanejonas Date: Wed, 26 Feb 2020 11:54:24 -0800 Subject: [PATCH] fix: remove pending transactions from dashboard fixes #225 fixes #265 --- src/components/NodeList/NodeList.tsx | 38 ---------------------------- src/components/NodeList/index.ts | 2 -- src/containers/Dashboard.tsx | 11 -------- src/translations/cn.ts | 1 - src/translations/en.ts | 1 - src/translations/kr.ts | 1 - 6 files changed, 54 deletions(-) delete mode 100644 src/components/NodeList/NodeList.tsx delete mode 100644 src/components/NodeList/index.ts diff --git a/src/components/NodeList/NodeList.tsx b/src/components/NodeList/NodeList.tsx deleted file mode 100644 index acb4172b..00000000 --- a/src/components/NodeList/NodeList.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from "react"; -import { Link } from "react-router-dom"; - -interface IProps { - nodes: any[]; -} - -function NodeList(props: IProps) { - - const pendingTxs = (n: any) => { - if (n.pendingBlock) { - return {n.pendingBlock.transactions.length}; - } - return null; - }; - - return ( -
- {props.nodes.map((n: any) => ( -
-
- {n.url} : {n.blockNumber}, pending Txs: {pendingTxs(n) || "..."} -
-
{n.clientVersion}
-
network id: {n.networkId} gasPrice: {n.gasPrice ? n.gasPrice.toString() + " Wei" : ""}
-
chain id: {n.chainId}
-
{n.error && {n.error}}
-
- View -
-
- - ))} -
- ); -} - -export default NodeList; diff --git a/src/components/NodeList/index.ts b/src/components/NodeList/index.ts deleted file mode 100644 index bd7e3c29..00000000 --- a/src/components/NodeList/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import NodeList from "./NodeList"; -export default NodeList; diff --git a/src/containers/Dashboard.tsx b/src/containers/Dashboard.tsx index e1df9e9e..6eef3aaf 100644 --- a/src/containers/Dashboard.tsx +++ b/src/containers/Dashboard.tsx @@ -36,14 +36,8 @@ export default (props: any) => { const [syncing, setSyncing] = useState(); const [peerCount, setPeerCount] = useState(); - const [pendingTransctionsLength, setPendingTransactionsLength] = useState(0); const { t } = useTranslation(); - React.useEffect(() => { - if (!erpc) { return; } - erpc.eth_pendingTransactions().then((p) => setPendingTransactionsLength(p.length)); - }, [erpc]); - React.useEffect(() => { if (!erpc) { return; } erpc.eth_chainId().then(setChainId); @@ -126,11 +120,6 @@ export default (props: any) => { } - - - {{pendingTransctionsLength}} - - {hexToNumber(peerCount)} diff --git a/src/translations/cn.ts b/src/translations/cn.ts index 7d3f12ea..ff513d33 100644 --- a/src/translations/cn.ts +++ b/src/translations/cn.ts @@ -13,7 +13,6 @@ export default { "Syncing": "同步中", "Gas Price": "Gas 费用", "Network Hash Rate": "算力", - "Pending Transactions": "等待中的交易", "Peers": "端点", "Hash Rate": "Hash Rate", "Transaction Count": "Transaction Count", diff --git a/src/translations/en.ts b/src/translations/en.ts index 728c1f06..a4edf1f7 100644 --- a/src/translations/en.ts +++ b/src/translations/en.ts @@ -11,7 +11,6 @@ export default { "Syncing": "Syncing", "Gas Price": "Gas Price", "Network Hash Rate": "Network Hash Rate", - "Pending Transactions": "PendingTransactions", "Peers": "Peers", "Hash Rate": "Hash Rate", "Transaction Count": "Transaction Count", diff --git a/src/translations/kr.ts b/src/translations/kr.ts index 04865da4..9cb26782 100644 --- a/src/translations/kr.ts +++ b/src/translations/kr.ts @@ -13,7 +13,6 @@ export default { "Syncing": "동기화", "Gas Price": "Gas 비용", "Network Hash Rate": "해시파워", - "Pending Transactions": "대기인 거래", "Peers": "거점", "Hash Rate": "Hash Rate", "Transaction Count": "Transaction Count",