diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 19:27:23 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 19:27:23 +0200 |
| commit | dd469b4ff7f9945864aa2da0e23fd466334884aa (patch) | |
| tree | f2b61ee34633ce89dee2790ab4d10818bf1fe7b9 /app/client/live/index.js | |
| parent | b19ebab84c13edadee0f2d6033e9b50b37842d17 (diff) | |
onchange
Diffstat (limited to 'app/client/live/index.js')
| -rw-r--r-- | app/client/live/index.js | 12 |
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, |
