diff --git a/src/recordings.jsx b/src/recordings.jsx index 62dfa60..ef4156c 100644 --- a/src/recordings.jsx +++ b/src/recordings.jsx @@ -237,7 +237,6 @@ class Logs extends React.Component { this.start = null; this.end = null; this.hostname = null; - this.earlier_than = null; this.state = { serverTimeOffset: null, cursor: null, @@ -344,26 +343,14 @@ class Logs extends React.Component { this.getServerTimeOffset(); } - componentDidMount() { - if (this.props.recording) { - if (this.start === null && this.end === null) { - this.end = this.props.recording.start + 3600; - this.start = this.props.recording.start; - this.earlier_than = this.props.recording.start; - } - if (this.props.recording.hostname) { - this.hostname = this.props.recording.hostname; - } - this.getLogs(); - } - } - componentDidUpdate() { if (this.props.recording) { if (this.start === null && this.end === null) { this.end = this.props.recording.start + 3600; this.start = this.props.recording.start; - this.earlier_than = this.props.recording.start; + } + if (this.props.recording.hostname) { + this.hostname = this.props.recording.hostname; } this.getLogs(); } @@ -373,6 +360,16 @@ class Logs extends React.Component { } } + componentWillUnmount() { + this.journalCtl.stop(); + this.setState({ + serverTimeOffset: null, + cursor: null, + after: null, + entries: [], + }); + } + render() { let r = this.props.recording; if (r == null) {