1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00
Files
Boostnote/browser/main/Mixins/OnlyGuest.js
2015-07-12 19:24:44 +09:00

19 lines
492 B
JavaScript

var AuthStore = require('../Stores/AuthStore')
var OnlyGuest = {
componentDidMount: function () {
if (AuthStore.check()) {
var user = AuthStore.getUser()
console.log(user)
var planet = user.Planets.length > 0 ? user.Planets[0] : null
if (planet == null) {
this.transitionTo('user', {userName: user.name})
return
}
this.transitionTo('dashboard', {userName: user.name, planetName: planet.name})
}
}
}
module.exports = OnlyGuest