var React = require('react') var Icon = require('icon.jsx') var Link = require('react-router').Link var Updater = React.createClass({ componentDidMount () { if (this.props.api) this.checkForUpdates(this.props.api) }, componentWillReceiveProps (props) { this.checkForUpdates(props.api) }, checkForUpdates (boards) { var v = window.location.pathname if (/\/ipfs\/./.test(v)) { boards.getIPFS().path.resolve(v.substring(6), (err, res) => { console.log('PATH RESOLVE', err, res) }) } }, render () { return
} }) module.exports = function (boardsAPI) { return React.createClass({ getInitialState: function () { return { loading: true } }, componentDidMount () { boardsAPI.use(boards => { if (boards.isInit) this.setState({ api: boards }) boards.getEventEmitter().on('init', err => { if (!this.isMounted()) return if (err) { this.setState({ loading: false, api: false }) } else { this.setState({ api: boards }) } }) }) }, extraButtons: function () { if (this.state.api) { return