Fix local tx requests (#3589)

* [localtx] Poll every second, dettach on unmount

* Fixed webpack config for dapps

* Fixed webpack PROXY config
This commit is contained in:
Nicolas Gotchac 2016-11-23 21:35:10 +01:00 committed by Jaco Greeff
parent 2996499a06
commit d429f5526f
2 changed files with 12 additions and 7 deletions

View File

@ -32,8 +32,13 @@ export default class Application extends Component {
} }
componentDidMount () { componentDidMount () {
const poll = () => this.fetchTransactionData().then(poll).catch(poll); const poll = () => {
this._timeout = setTimeout(poll, 2000); this._timeout = window.setTimeout(() => {
this.fetchTransactionData().then(poll).catch(poll);
}, 1000);
};
poll();
} }
componentWillUnmount () { componentWillUnmount () {

View File

@ -207,13 +207,13 @@ module.exports = {
autoRewrite: true autoRewrite: true
}, },
{ {
context: '/api/*', context: '/api',
target: 'http://127.0.0.1:8080', target: 'http://127.0.0.1:8080',
changeOrigin: true, changeOrigin: true,
autoRewrite: true autoRewrite: true
}, },
{ {
context: '/app/*', context: '/app',
target: 'http://127.0.0.1:8080', target: 'http://127.0.0.1:8080',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
@ -221,7 +221,7 @@ module.exports = {
} }
}, },
{ {
context: '/parity-utils/*', context: '/parity-utils',
target: 'http://127.0.0.1:3000', target: 'http://127.0.0.1:3000',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
@ -229,8 +229,8 @@ module.exports = {
} }
}, },
{ {
context: '/rpc/*', context: '/rpc',
target: 'http://localhost:8080', target: 'http://127.0.0.1:8080',
changeOrigin: true changeOrigin: true
} }
] ]