1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

add name change for planet & fix minor bugs

This commit is contained in:
Rokt33r
2015-07-23 07:55:56 +09:00
parent cdf6ed47dd
commit 2f754bbb87
11 changed files with 91 additions and 86 deletions

View File

@@ -27,6 +27,8 @@ module.exports = React.createClass({
this.unsubscribe()
},
onListen: function (res) {
if (res.status == null) return
if (res.status === 'planetCreated') {
var currentUser = this.state.currentUser
currentUser.Planets.push(res.data)
@@ -34,6 +36,10 @@ module.exports = React.createClass({
localStorage.setItem('user', JSON.stringify(currentUser))
this.setState({currentUser: currentUser})
}
if (res.status === 'nameChanged') {
this.setState({currentUser: AuthStore.getUser()})
}
},
render: function () {
var currentPlanetName = this.props.params.planetName