var React = require('react') var Icon = require('icon.jsx') var GetIPFS = require('getipfs.jsx') var UserID = require('userID.jsx') module.exports = function (boardsAPI) { return React.createClass({ getInitialState () { return { users: [], api: false } }, componentDidMount () { boardsAPI.use(boards => { this.init(boards) boards.getEventEmitter().on('user', (id) => { if (id === undefined || id === 'undefined') console.log('found undefined user???') if (this.isMounted() && this.state.users.indexOf(id) < 0) { this.setState({ users: this.state.users.concat(id) }) } }) }) }, init (boards) { this.setState({ users: boards.getUsers(), api: boards }) boards.searchUsers() }, render () { if (this.state.api) { return
Found {this.state.users.length} users