From 794a52e485e15e4bf86c849e135d49783c91539b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 22 Jun 2018 16:35:33 +0200 Subject: deletorrr --- app/client/modules/pix2pixhd/pix2pixhd.reducer.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/client/modules/pix2pixhd/pix2pixhd.reducer.js') diff --git a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js index b6264ed..6b2366c 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.reducer.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.reducer.js @@ -21,6 +21,18 @@ const pix2pixhdReducer = (state = pix2pixhdInitialState, action) => { ...state, results: action.results, } + 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) + } + } default: return state } -- cgit v1.2.3-70-g09d2