diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-08-07 16:57:46 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:45:27 +0800 |
commit | 5dcd8ceb7bbaef33fef5588feceac17577679e74 (patch) | |
tree | a50c48dbdf3cc376bcdd03de64845aa5bed97b51 /ui/app/higher-order-components | |
parent | 9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7 (diff) | |
download | tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar.gz tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar.bz2 tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar.lz tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar.xz tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar.zst tangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.zip |
Fix e2e tests
Diffstat (limited to 'ui/app/higher-order-components')
-rw-r--r-- | ui/app/higher-order-components/with-method-data/with-method-data.component.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ui/app/higher-order-components/with-method-data/with-method-data.component.js b/ui/app/higher-order-components/with-method-data/with-method-data.component.js index c05d33c20..fed7d9865 100644 --- a/ui/app/higher-order-components/with-method-data/with-method-data.component.js +++ b/ui/app/higher-order-components/with-method-data/with-method-data.component.js @@ -13,10 +13,8 @@ export default function withMethodData (WrappedComponent) { } state = { - methodData: { - data: {}, - }, - isFetching: false, + methodData: {}, + done: false, error: null, } @@ -29,24 +27,24 @@ export default function withMethodData (WrappedComponent) { const { txParams: { data = '' } = {} } = transaction if (data) { - this.setState({ isFetching: true }) - try { const methodData = await getMethodData(data) - this.setState({ methodData, isFetching: false }) + this.setState({ methodData, done: true }) } catch (error) { - this.setState({ isFetching: false, error }) + this.setState({ done: true, error }) } + } else { + this.setState({ done: true }) } } render () { - const { methodData, isFetching, error } = this.state + const { methodData, done, error } = this.state return ( <WrappedComponent { ...this.props } - methodData={{ data: methodData, isFetching, error }} + methodData={{ data: methodData, done, error }} /> ) } |