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}/> <Service name={name} key={name} graph={graphs[name]} {...info}/>
)) ))
let notice = null
const down = allServices.filter(([, { status }]) => !status) const down = allServices.filter(([, { status }]) => !status)
const notice = down.length > 0
if (down.length !== 0) { ? <DegradedNotice services={objectFromEntries(down)}/>
// a service is down :( : null
notice = <DegradedNotice services={objectFromEntries(down)}/>
}
metrics = ( metrics = (
<div className="services"> <div className="services">