summaryrefslogtreecommitdiff
path: root/app/client/live/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/live/index.js')
-rw-r--r--app/client/live/index.js12
1 files changed, 4 insertions, 8 deletions
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,