From c3dbf9685df77ba9dbf6d7c757d0b43bfbd1aea7 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 29 Nov 2018 01:06:58 +0200 Subject: [PATCH] Fix clearing log focus --- .../frontend/src/pages/dashboard/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/maubot/management/frontend/src/pages/dashboard/index.js b/maubot/management/frontend/src/pages/dashboard/index.js index c042fe8..a688ff5 100644 --- a/maubot/management/frontend/src/pages/dashboard/index.js +++ b/maubot/management/frontend/src/pages/dashboard/index.js @@ -33,7 +33,7 @@ class Dashboard extends Component { plugins: {}, sidebarOpen: false, modalOpen: false, - logFocus: "", + logFocus: null, } this.logLines = [] this.logMap = {} @@ -126,16 +126,18 @@ class Dashboard extends Component { entry, onDelete: () => this.delete(field, id), onChange: newEntry => this.add(field, newEntry, id), - openLog: filter => { - this.setState({ - logFocus: filter, - }) - this.logModal.open() - }, + openLog: this.openLog, ctx: this.state, }) } + openLog = filter => { + this.setState({ + logFocus: typeof filter === "string" ? filter : null, + }) + this.logModal.open() + } + renderNotFound = (thing = "path") => (
Oops! I'm afraid that {thing} couldn't be found. @@ -185,7 +187,7 @@ class Dashboard extends Component {
- }/> + }/> this.add("instances", newEntry)} ctx={this.state}/>}/>