aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/higher-order-components
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-08-07 16:57:46 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-08-24 07:45:27 +0800
commit5dcd8ceb7bbaef33fef5588feceac17577679e74 (patch)
treea50c48dbdf3cc376bcdd03de64845aa5bed97b51 /ui/app/higher-order-components
parent9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7 (diff)
downloadtangerine-wallet-browser-5dcd8ceb7bbaef33fef5588feceac17577679e74.tar.gz
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.js18
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 }}
/>
)
}