From bd93fb76126a2c0f4d054fa9f51a521801b69d4d Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Sat, 12 Dec 2015 17:21:58 +0100 Subject: [PATCH] fix getipfs page --- webapp/pages/getipfs.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/webapp/pages/getipfs.jsx b/webapp/pages/getipfs.jsx index 588a29f..4c88851 100644 --- a/webapp/pages/getipfs.jsx +++ b/webapp/pages/getipfs.jsx @@ -13,9 +13,6 @@ module.exports = React.createClass({ if(boards.isInit){ this.setState({ connected: true }) } else { - setTimeout(_ => { - if(this.isMounted()) this.setState({ long: true }) - }, 5000) boards.getEventEmitter().on('init', err => { if(!this.isMounted()) return if(err){ @@ -25,11 +22,17 @@ module.exports = React.createClass({ } }) } - } + } else this.startTimer() + }, + startTimer: function(){ + setTimeout(_ => { + console.log('Connection to go-ipfs has timed out (probably due to CORS)') + if(this.isMounted()) this.setState({ long: true }) + }, 5000) }, render: function(){ var opt = require('options.jsx').get() - if(this.state.error){ + if(this.state.error || this.state.long){ return (

Connection to IPFS not available

@@ -57,7 +60,6 @@ module.exports = React.createClass({ return

Connecting to IPFS

- {this.state.long?(

It's taking long... there's probably something wrong

):

}
} }