Fix Logs View

This commit is contained in:
Kyrylo Gliebov 2018-09-25 11:19:50 +02:00
parent 1abe64fe0c
commit 2aa3270d97

View file

@ -608,32 +608,6 @@ export class Player extends React.Component {
this.awaitPacket(0); this.awaitPacket(0);
} }
componentWillMount() {
let term = new Term({
cols: this.state.cols,
rows: this.state.rows,
screenKeys: true,
useStyle: true
});
term.on('title', this.handleTitleChange);
this.setState({ term: term });
window.addEventListener("keydown", this.handleKeyDown, false);
}
componentDidMount() {
if (this.refs.wrapper.offsetWidth) {
this.setState({containerWidth: this.refs.wrapper.offsetWidth});
}
/* Open the terminal */
this.state.term.open(this.refs.term);
window.setInterval(this.sync, 100);
/* Reset playback */
this.reset();
}
/* Subscribe for a packet at specified index */ /* Subscribe for a packet at specified index */
awaitPacket(idx) { awaitPacket(idx) {
this.buf.awaitPacket(idx).done(this.handlePacket) this.buf.awaitPacket(idx).done(this.handlePacket)
@ -954,6 +928,33 @@ export class Player extends React.Component {
this._transform(); this._transform();
} }
componentWillMount() {
let term = new Term({
cols: this.state.cols,
rows: this.state.rows,
screenKeys: true,
useStyle: true
});
term.on('title', this.handleTitleChange);
this.setState({ term: term });
window.addEventListener("keydown", this.handleKeyDown, false);
}
componentDidMount() {
if (this.refs.wrapper.offsetWidth) {
this.setState({containerWidth: this.refs.wrapper.offsetWidth});
}
/* Open the terminal */
this.state.term.open(this.refs.term);
window.setInterval(this.sync, 100);
/* Reset playback */
this.reset();
this.fastForwardToTS(0);
}
componentWillUpdate(nextProps, nextState) { componentWillUpdate(nextProps, nextState) {
/* If we changed pause state or speed exponent */ /* If we changed pause state or speed exponent */
if (nextState.paused != this.state.paused || if (nextState.paused != this.state.paused ||