mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
21 lines
518 B
JavaScript
21 lines
518 B
JavaScript
var AuthStore = require('../Stores/AuthStore')
|
|
|
|
var OnlyGuest = {
|
|
componentDidMount: function () {
|
|
if (AuthStore.check()) {
|
|
var user = AuthStore.getUser()
|
|
if (user == null) {
|
|
return
|
|
}
|
|
var planet = user.Planets.length > 0 ? user.Planets[0] : null
|
|
if (planet == null) {
|
|
this.transitionTo('user', {userName: user.name})
|
|
return
|
|
}
|
|
this.transitionTo('planetHome', {userName: user.name, planetName: planet.name})
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = OnlyGuest
|