From 2aa3270d97e10cb62a73425a7f0a00a6fe679c65 Mon Sep 17 00:00:00 2001 From: Kyrylo Gliebov Date: Tue, 25 Sep 2018 11:19:50 +0200 Subject: [PATCH] Fix Logs View --- src/player.jsx | 53 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/player.jsx b/src/player.jsx index d04cb5e..6cc6741 100644 --- a/src/player.jsx +++ b/src/player.jsx @@ -608,32 +608,6 @@ export class Player extends React.Component { 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 */ awaitPacket(idx) { this.buf.awaitPacket(idx).done(this.handlePacket) @@ -954,6 +928,33 @@ export class Player extends React.Component { 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) { /* If we changed pause state or speed exponent */ if (nextState.paused != this.state.paused ||