1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

new folder modal / key indexing for article / login bugfix

This commit is contained in:
Rokt33r
2015-10-16 13:32:58 +09:00
parent 832ca3347c
commit a1810e6023
17 changed files with 309 additions and 85 deletions

View File

@@ -13,8 +13,8 @@ require('../styles/main/index.styl')
function onlyUser (state, replaceState) {
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
if (currentUser == null) replaceState('login', '/login')
if (state.location.pathname === '/') replaceState('user', '/users/' + currentUser.id)
if (currentUser == null) return replaceState('login', '/login')
if (state.location.pathname === '/') return replaceState('user', '/users/' + currentUser.id)
}
let routes = (
@@ -62,18 +62,6 @@ React.render((
.then(function (res) {
let user = res.body
store.dispatch(updateUser(user))
let users = [user].concat(user.Teams)
users.forEach(user => {
fetchArticles(user.id)
.then(res => {
store.dispatch(refreshArticles(user.id, res.body))
})
.catch(err => {
if (err.status == null) throw err
console.error(err)
})
})
})
.catch(function (err) {
console.error(err.message)