refactor if statement to ternary

This commit is contained in:
slice 2018-07-16 18:16:39 -07:00
parent 637a06e985
commit 31f171e94a
No known key found for this signature in database
GPG Key ID: 1508C19D7436A26D
1 changed files with 3 additions and 6 deletions

View File

@ -185,13 +185,10 @@ export default class App extends Component {
<Service name={name} key={name} graph={graphs[name]} {...info}/>
))
let notice = null
const down = allServices.filter(([, { status }]) => !status)
if (down.length !== 0) {
// a service is down :(
notice = <DegradedNotice services={objectFromEntries(down)}/>
}
const notice = down.length > 0
? <DegradedNotice services={objectFromEntries(down)}/>
: null
metrics = (
<div className="services">