diff options
Diffstat (limited to 'app/client/live')
| -rw-r--r-- | app/client/live/live.reducer.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/app/client/live/live.reducer.js b/app/client/live/live.reducer.js index 8112d31..d352d25 100644 --- a/app/client/live/live.reducer.js +++ b/app/client/live/live.reducer.js @@ -23,7 +23,7 @@ const liveInitialState = { } const liveReducer = (state = liveInitialState, action) => { - console.log(action) + // console.log(action) let results; switch(action.type) { case types.socket.load_params: @@ -110,6 +110,23 @@ const liveReducer = (state = liveInitialState, action) => { case types.system.stdout: if (action.data.processor === 'gpu') { + // receive parameter updates from the app + if (action.data.data.indexOf('set_opt') !== -1) { + const new_opt = action.data.data.trim().split('\n').reduce((a,b) => { + if (b.indexOf('set_opt') === 0) { + const terms = b.split(' ') + a[terms[1]] = terms[2] + } + return a + }, {}) + return { + ...state, + opt: { + ...state.opt, + [line[1]]: line[2], + } + } + } return { ...state, last_message: action.data.data, |
