summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-22 16:54:31 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-22 16:54:31 +0200
commit4df8529b5adee1b75a64c8b536c5be763ed9c811 (patch)
treeaa6a34ddc646cecca96f7d783085f8c64bc5bb24
parent440d9c7c2c080fcfbfdeb7bbbc4c654666ea987f (diff)
fix reducer
-rw-r--r--app/client/dataset/dataset.reducer.js2
-rw-r--r--app/client/modules/pix2pixhd/pix2pixhd.reducer.js5
2 files changed, 2 insertions, 5 deletions
diff --git a/app/client/dataset/dataset.reducer.js b/app/client/dataset/dataset.reducer.js
index 3c2dddd..f536960 100644
--- a/app/client/dataset/dataset.reducer.js
+++ b/app/client/dataset/dataset.reducer.js
@@ -169,7 +169,7 @@ function handleFileUpdate(state, action){
}
function handleFileDestroy(state, action){
- if (! state.data) return
+ if (! state.data) return state
// delete the key from fileLookup
let fileLookup = {
...state.data.fileLookup
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js
index 6b2366c..c3d52a3 100644
--- a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js
+++ b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js
@@ -23,14 +23,11 @@ const pix2pixhdReducer = (state = pix2pixhdInitialState, action) => {
}
case types.file.destroy:
console.log('file destroy', state.results)
- if (! state.results) {
- return state
- }
return {
...state,
results: {
...state.results,
- files: state.results.files.filter(file.id !== action.data.id)
+ files: state.results.files.filter(f => f.id !== action.data.id)
}
}
default: