Fix clearing log focus

This commit is contained in:
Tulir Asokan 2018-11-29 01:06:58 +02:00
parent 32b60fa0ff
commit c3dbf9685d

View File

@ -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") => (
<div className="not-found">
Oops! I'm afraid that {thing} couldn't be found.
@ -185,7 +187,7 @@ class Dashboard extends Component {
<main className="view">
<Switch>
<Route path="/" exact render={() => <Home openLog={this.logModal.open}/>}/>
<Route path="/" exact render={() => <Home openLog={this.openLog}/>}/>
<Route path="/new/instance" render={() =>
<Instance onChange={newEntry => this.add("instances", newEntry)}
ctx={this.state}/>}/>