summaryrefslogtreecommitdiff
path: root/client/reducers
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-19 02:31:06 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-19 02:31:06 +0200
commite9c0ffcd5d58310c6cff6a5a73bdf6062485eba4 (patch)
tree0bae9e0d9f7f19bbd2433fa8f7f930b9210bf25c /client/reducers
parent9c5b96aec109f7b37cb2c861525a084a65a817ea (diff)
etc
Diffstat (limited to 'client/reducers')
-rw-r--r--client/reducers/folders.js1
-rw-r--r--client/reducers/tasks.js3
2 files changed, 3 insertions, 1 deletions
diff --git a/client/reducers/folders.js b/client/reducers/folders.js
index bec4ad3..e77c954 100644
--- a/client/reducers/folders.js
+++ b/client/reducers/folders.js
@@ -3,7 +3,6 @@ import client from '../client'
const folders = (state = {}, action) => {
let file, files, folders, folder, openFolders, folder_id, filesAreLoaded
- console.log(action)
switch (action.type) {
case 'LOAD_FOLDERS':
return {
diff --git a/client/reducers/tasks.js b/client/reducers/tasks.js
index 470c7a7..c5f2c06 100644
--- a/client/reducers/tasks.js
+++ b/client/reducers/tasks.js
@@ -5,8 +5,10 @@ const tasks = (state = [], action) => {
switch (action.type) {
case 'LOAD_TASKS':
return action.tasks
+
case 'ADD_TASK':
return [action.task].concat(state)
+
case 'TASK_UPDATED':
const updated_tasks = state.map(task => {
if (task.id == id) {
@@ -15,6 +17,7 @@ const tasks = (state = [], action) => {
return id
})
return updated_tasks
+
default:
return state
}