1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

on Refactor... #4

This commit is contained in:
Rokt33r
2015-08-19 04:05:38 +09:00
parent 484dfe6726
commit 0b4cfd6563
16 changed files with 377 additions and 114 deletions

View File

@@ -49,13 +49,16 @@ module.exports = React.createClass({
Hq.getUser()
.then(function (res) {
console.log(res.body)
localStorage.setItem('currentUser', JSON.stringify(res.body))
UserStore.Actions.update(res.body)
})
.catch(function (err) {
if (err.status === 401) {
console.log('Not logged in yet')
localStorage.removeItem('currentUser')
this.transitionTo('login')
return
}
console.error(err)
}.bind(this))