From 4a81630073baa9989168f342c5296eac1cf71a02 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 27 Feb 2022 00:17:40 -0800 Subject: [PATCH] Fixed: Clearing logs not updating UI once complete (cherry picked from commit 56b3acddc9f50f59c78c03ca072fe802752b88a7) --- frontend/src/System/Events/LogsTableConnector.js | 9 ++++++++- .../src/System/Logs/Files/LogFilesConnector.js | 15 ++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/src/System/Events/LogsTableConnector.js b/frontend/src/System/Events/LogsTableConnector.js index 20e6eafbf..a717cba15 100644 --- a/frontend/src/System/Events/LogsTableConnector.js +++ b/frontend/src/System/Events/LogsTableConnector.js @@ -96,7 +96,14 @@ class LogsTableConnector extends Component { }; onClearLogsPress = () => { - this.props.executeCommand({ name: commandNames.CLEAR_LOGS }); + this.props.executeCommand({ + name: commandNames.CLEAR_LOGS, + commandFinished: this.onCommandFinished + }); + }; + + onCommandFinished = () => { + this.props.gotoLogsFirstPage(); }; // diff --git a/frontend/src/System/Logs/Files/LogFilesConnector.js b/frontend/src/System/Logs/Files/LogFilesConnector.js index 03d958b33..98a55f32f 100644 --- a/frontend/src/System/Logs/Files/LogFilesConnector.js +++ b/frontend/src/System/Logs/Files/LogFilesConnector.js @@ -50,12 +50,6 @@ class LogFilesConnector extends Component { this.props.fetchLogFiles(); } - componentDidUpdate(prevProps) { - if (prevProps.deleteFilesExecuting && !this.props.deleteFilesExecuting) { - this.props.fetchLogFiles(); - } - } - // // Listeners @@ -64,7 +58,14 @@ class LogFilesConnector extends Component { }; onDeleteFilesPress = () => { - this.props.executeCommand({ name: commandNames.DELETE_LOG_FILES }); + this.props.executeCommand({ + name: commandNames.DELETE_LOG_FILES, + commandFinished: this.onCommandFinished + }); + }; + + onCommandFinished = () => { + this.props.fetchLogFiles(); }; //