From 671b5e1f93a626ce9c39420760818fbf029642ed Mon Sep 17 00:00:00 2001 From: shanejonas Date: Thu, 27 Jun 2019 11:45:13 -0700 Subject: [PATCH] fix: upgrade typescript --- package.json | 2 +- src/containers/Dashboard.tsx | 12 +++++++----- src/helpers.tsx | 2 +- src/themes/jadeTheme.ts | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index dcf1b186..c8a87ddf 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "ts-node": "^3.3.0", "tslint": "^5.8.0", "tslint-react": "^4.0.0", - "typescript": "^3.0.1" + "typescript": "^3.5.2" }, "browserslist": { "production": [ diff --git a/src/containers/Dashboard.tsx b/src/containers/Dashboard.tsx index 76a17b07..425d8d87 100644 --- a/src/containers/Dashboard.tsx +++ b/src/containers/Dashboard.tsx @@ -74,7 +74,7 @@ export default (props: any) => { }, [chainId, erpc]); React.useEffect(() => { - if (!erpc || blockNumber === null) { return; } + if (!erpc || blockNumber === undefined) { return; } erpc.eth_getBlockByNumber(`0x${blockNumber.toString(16)}`, true).then(setBlock); }, [blockNumber, erpc]); @@ -182,10 +182,12 @@ export default (props: any) => { - - - - + {blockNumber && + + + + + } ); diff --git a/src/helpers.tsx b/src/helpers.tsx index 9c663c6d..3fc0ab34 100644 --- a/src/helpers.tsx +++ b/src/helpers.tsx @@ -11,7 +11,7 @@ export const getBlocks = (from: number, to: number, erpc: ERPC): Promise => }; export const useBlockNumber = (erpc: ERPC) => { - const [blockNumber, setBlockNumber] = React.useState(0); + const [blockNumber, setBlockNumber] = React.useState(); useInterval(() => { if (!erpc) { return; diff --git a/src/themes/jadeTheme.ts b/src/themes/jadeTheme.ts index bfbf8c7d..19f857ef 100644 --- a/src/themes/jadeTheme.ts +++ b/src/themes/jadeTheme.ts @@ -40,4 +40,4 @@ export const darkTheme = createMuiTheme({ export default { darkTheme, lightTheme, -}; \ No newline at end of file +};