From f2e5bc29033ec1879f89a2d9b1c2266e09abdc3d Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Wed, 6 Nov 2019 11:27:54 -0500 Subject: [PATCH] Reset Logs View on Player Rewind --- src/player.jsx | 3 +++ src/recordings.jsx | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/player.jsx b/src/player.jsx index 68bf5f5..a858765 100644 --- a/src/player.jsx +++ b/src/player.jsx @@ -974,6 +974,9 @@ export class Player extends React.Component { this.clearInputPlayer(); this.reset(); this.sync(); + if (this.props.logsEnabled) { + this.props.onRewindStart(); + } } fastForwardToEnd() { diff --git a/src/recordings.jsx b/src/recordings.jsx index f92a2e8..41a39c3 100644 --- a/src/recordings.jsx +++ b/src/recordings.jsx @@ -403,6 +403,7 @@ class Recording extends React.Component { this.handleTsChange = this.handleTsChange.bind(this); this.handleLogTsChange = this.handleLogTsChange.bind(this); this.handleLogsClick = this.handleLogsClick.bind(this); + this.handleLogsReset = this.handleLogsReset.bind(this); this.state = { curTs: null, logsTs: null, @@ -422,6 +423,12 @@ class Recording extends React.Component { this.setState({logsEnabled: !this.state.logsEnabled}); } + handleLogsReset() { + this.setState({logsEnabled: false}, () => { + this.setState({logsEnabled: true}); + }); + } + goBackToList() { if (cockpit.location.path[0]) { if ("search_rec" in cockpit.location.options) { @@ -446,7 +453,8 @@ class Recording extends React.Component { search={this.props.search} onTsChange={this.handleTsChange} recording={r} - logsEnabled={this.state.logsEnabled} />); + logsEnabled={this.state.logsEnabled} + onRewindStart={this.handleLogsReset} />); return (