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 (
It's taking long... there's probably something wrong
):}