var React = require('react') var Link = require('react-router').Link var Icon = require('icon.jsx') module.exports = function(){ return React.createClass({ getInitialState: function(){ return { connected: false, error: false, long: false } }, componentDidMount: function(){ var boards = this.props.api if(boards){ if(!this.isMounted()) return 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){ this.setState({ error: true }) } else { this.setState({ connected: true }) } }) } } }, render: function(){ var opt = require('options.jsx').get() if(this.state.error){ return (

Connection to IPFS not available

Sorry, but at the moment an external application is needed to try the Prototype

You don't have an IPFS node running at {opt.addr}:{opt.port} or it is not reachable. The IPFS Boards prototype requires a full IPFS node. Please start one by following the go-ipfs documentation.

Do you have a running node but the app won't work?

It's probably one of these issues:

Still can't fix it? File a issue on GitHub, we'll be happy to help!

)} else if(this.state.connected){ return

You're connected!
} else { return

Connecting to IPFS

{this.state.long?(

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

):

}
} } }) }