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

User name change and modify style

This commit is contained in:
Rokt33r
2015-12-03 05:32:10 +09:00
parent 96a8687896
commit 1a11095121
8 changed files with 132 additions and 21 deletions

View File

@@ -12,6 +12,9 @@ import {
UNLOCK_STATUS,
TOGGLE_TUTORIAL,
// user
USER_UPDATE,
// Article action type
ARTICLE_UPDATE,
ARTICLE_DESTROY,
@@ -42,10 +45,22 @@ const initialStatus = {
let data = dataStore.getData()
let initialArticles = data.articles
let initialFolders = data.folders
let initialUser = dataStore.getUser().user
let isStatusLocked = false
let isCreatingNew = false
function user (state = initialUser, action) {
switch (action.type) {
case USER_UPDATE:
let updated = Object.assign(state, action.data)
dataStore.saveUser(updated)
return updated
default:
return state
}
}
function folders (state = initialFolders, action) {
state = state.slice()
switch (action.type) {
@@ -250,6 +265,7 @@ function status (state = initialStatus, action) {
}
export default combineReducers({
user,
folders,
articles,
status