1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 18:56:22 +00:00

add user management for planet setting modal

This commit is contained in:
Rokt33r
2015-07-24 19:05:11 +09:00
parent 2e4aaf7345
commit 867ec25e54
4 changed files with 87 additions and 4 deletions

View File

@@ -220,6 +220,24 @@ module.exports = React.createClass({
return
}
if (res.status === 'userRemoved') {
var user = res.data
if (user == null) {
return null
}
this.state.currentPlanet.Users.some(function (_user, index) {
if (user.id === _user.id) {
this.state.currentPlanet.Users.splice(index, 1)
return true
}
return false
}.bind(this))
this.setState({currentPlanet: this.state.currentPlanet}, function () {
if (this.state.isAddUserModalOpen) {this.closeAddUserModal()}
})
return
}
if (res.status === 'nameChanged') {
var params = Object.assign({}, this.props.params)
params.planetName = res.data.name