diff --git a/src/config.jsx b/src/config.jsx index 41ce7be..dcb24a2 100644 --- a/src/config.jsx +++ b/src/config.jsx @@ -181,7 +181,7 @@ class Config extends React.Component { this.setState({file_error: reason}); } - componentWillMount() { + componentDidMount() { this.getConfig(); this.readConfig(); } @@ -393,7 +393,7 @@ class SssdConfig extends React.Component { } } - componentWillMount() { + componentDidMount() { let syntax_object = { parse: ini.parse, stringify: ini.stringify diff --git a/src/player.jsx b/src/player.jsx index 92503d6..0824f3b 100644 --- a/src/player.jsx +++ b/src/player.jsx @@ -697,8 +697,16 @@ export class Player extends React.Component { cols: 80, rows: 25, title: _("Player"), - term: null, paused: true, + /* Terminal */ + term: new Term({ + cols: 80, + rows: 25, + screenKeys: true, + useStyle: true, + /* Exposes the xterm-accessibility-tree */ + screenReaderMode: true, + }), /* Speed exponent */ speedExp: 0, scale_initial: 1, @@ -1149,24 +1157,11 @@ 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, - /* Exposes the xterm-accessibility-tree */ - screenReaderMode: true, - }); - - term.on('title', this.handleTitleChange); - - this.setState({ term: term }); + componentDidMount() { + this.state.term.on('title', this.handleTitleChange); window.addEventListener("keydown", this.handleKeyDown, false); - } - componentDidMount() { if (this.refs.wrapper.offsetWidth) { this.setState({containerWidth: this.refs.wrapper.offsetWidth}); } diff --git a/src/recordings.jsx b/src/recordings.jsx index 41a39c3..a9393d1 100644 --- a/src/recordings.jsx +++ b/src/recordings.jsx @@ -339,7 +339,7 @@ class Logs extends React.Component { this.getLogs(); } - componentWillMount() { + componentDidMount() { this.getServerTimeOffset(); }