summaryrefslogtreecommitdiff
path: root/app/client/live/reducer.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/live/reducer.js')
-rw-r--r--app/client/live/reducer.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/client/live/reducer.js b/app/client/live/reducer.js
index df227e4..e056808 100644
--- a/app/client/live/reducer.js
+++ b/app/client/live/reducer.js
@@ -8,6 +8,7 @@ const liveInitialState = {
checkpoint_dir: ['latest'],
sequences: [],
fps: 0,
+ frame: { i: 0, sequence_i: 0, sequence_len: '1' }
}
const liveReducer = (state = liveInitialState, action) => {
@@ -44,7 +45,7 @@ const liveReducer = (state = liveInitialState, action) => {
case 'LIST_EPOCHS':
return {
...state,
- epochs: action.epochs.map(a => [ a == 'latest' ? Infinity : a, a ])
+ epochs: (action.epochs || []).map(a => [ a == 'latest' ? Infinity : a, a ])
.sort((a,b) => a[0] - b[0])
.map(a => a[1])
}
@@ -61,6 +62,12 @@ const liveReducer = (state = liveInitialState, action) => {
fps: action.fps,
}
+ case 'CURRENT_FRAME':
+ return action.meta ? {
+ ...state,
+ frame: action.meta
+ } : state
+
default:
return state
}