summaryrefslogtreecommitdiff
path: root/app/client/live
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-21 19:27:23 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-21 19:27:23 +0200
commitdd469b4ff7f9945864aa2da0e23fd466334884aa (patch)
treef2b61ee34633ce89dee2790ab4d10818bf1fe7b9 /app/client/live
parentb19ebab84c13edadee0f2d6033e9b50b37842d17 (diff)
onchange
Diffstat (limited to 'app/client/live')
-rw-r--r--app/client/live/actions.js2
-rw-r--r--app/client/live/index.js12
2 files changed, 5 insertions, 9 deletions
diff --git a/app/client/live/actions.js b/app/client/live/actions.js
index 46e0c6c..5bf06eb 100644
--- a/app/client/live/actions.js
+++ b/app/client/live/actions.js
@@ -38,5 +38,5 @@ export const load_epoch = (checkpoint, epoch) => {
export const seek = (frame) => {
socket.seek(frame)
- return { type: 'LOADING_CHECKPOINT', }
+ return { type: 'SEEKING', }
}
diff --git a/app/client/live/index.js b/app/client/live/index.js
index f632836..fb512a3 100644
--- a/app/client/live/index.js
+++ b/app/client/live/index.js
@@ -21,11 +21,7 @@ class App extends Component {
this.seek = this.seek.bind(this)
}
componentWillUpdate(nextProps) {
- console.log('willupdate', nextProps.opt)
- if (! nextProps.epochs || nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {
- this.props.actions.list_epochs(nextProps.opt.checkpoint_name)
- }
- if (! nextProps.epochs || nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {
+ if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {
this.props.actions.list_epochs(nextProps.opt.checkpoint_name)
}
}
@@ -40,7 +36,7 @@ class App extends Component {
this.props.actions.load_sequence(sequence)
}
seek(percentage){
- const frame = Math.floor(percentage * (this.props.opt.frame.sequence_len || 1) + 1
+ const frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1)
this.props.actions.seek(frame)
}
render(){
@@ -79,7 +75,7 @@ class App extends Component {
<Slider
name='position'
min={0.0} max={1.0} type='float'
- value={(this.opt.frame.sequence_i || 0) / (this.opt.frame.sequence_len || 1)}
+ value={(this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1)}
onChange={this.seek}
/>
</ParamGroup>
@@ -197,7 +193,7 @@ class App extends Component {
const mapStateToProps = state => ({
opt: state.live.opt,
- frame: state.live.frame
+ frame: state.live.frame,
checkpoints: state.live.checkpoints,
epochs: state.live.epochs,
sequences: state.live.sequences,