From d429f5526fd2dd252103df4189a39d6875e2d04d Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Wed, 23 Nov 2016 21:35:10 +0100 Subject: [PATCH] Fix local tx requests (#3589) * [localtx] Poll every second, dettach on unmount * Fixed webpack config for dapps * Fixed webpack PROXY config --- js/src/dapps/localtx/Application/application.js | 9 +++++++-- js/webpack.config.js | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/js/src/dapps/localtx/Application/application.js b/js/src/dapps/localtx/Application/application.js index 89b0b73b4..7d220611f 100644 --- a/js/src/dapps/localtx/Application/application.js +++ b/js/src/dapps/localtx/Application/application.js @@ -32,8 +32,13 @@ export default class Application extends Component { } componentDidMount () { - const poll = () => this.fetchTransactionData().then(poll).catch(poll); - this._timeout = setTimeout(poll, 2000); + const poll = () => { + this._timeout = window.setTimeout(() => { + this.fetchTransactionData().then(poll).catch(poll); + }, 1000); + }; + + poll(); } componentWillUnmount () { diff --git a/js/webpack.config.js b/js/webpack.config.js index b70123aff..f51a1457d 100644 --- a/js/webpack.config.js +++ b/js/webpack.config.js @@ -207,13 +207,13 @@ module.exports = { autoRewrite: true }, { - context: '/api/*', + context: '/api', target: 'http://127.0.0.1:8080', changeOrigin: true, autoRewrite: true }, { - context: '/app/*', + context: '/app', target: 'http://127.0.0.1:8080', changeOrigin: true, pathRewrite: { @@ -221,7 +221,7 @@ module.exports = { } }, { - context: '/parity-utils/*', + context: '/parity-utils', target: 'http://127.0.0.1:3000', changeOrigin: true, pathRewrite: { @@ -229,8 +229,8 @@ module.exports = { } }, { - context: '/rpc/*', - target: 'http://localhost:8080', + context: '/rpc', + target: 'http://127.0.0.1:8080', changeOrigin: true } ]