Skip to content

Commit

Permalink
refactor: change to const instead of let and use short circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
manudevelopia committed Jul 23, 2019
1 parent 57dec04 commit 2591d4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/js/components/CompoundsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class CompoundsForm extends React.Component<any, any> {
}

public render() {
const spinner = this.state.generatingReport ? <Spinner size="sm" color="light"/> : '';
const spinner = this.state.generatingReport && <Spinner size="sm" color="light"/>;

let compounds = this.props.selection.map((compound: any, index: number) => {
return <tr key={index}>
Expand Down Expand Up @@ -67,7 +67,7 @@ export class CompoundsForm extends React.Component<any, any> {
}

private removeFromSelected(index: number) {
let results = this.state.compounds.slice();
const results = this.state.compounds.slice();

results.splice(this.state.compounds[index], 1);
this.setState({compounds: results});
Expand Down
2 changes: 1 addition & 1 deletion src/main/js/components/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Search extends React.Component<any, any> {

render() {

const spinner = this.state.searching ? <Spinner size="sm" color="light"/> : '';
const spinner = this.state.searching && <Spinner size="sm" color="light"/>;

return (
<Row>
Expand Down

0 comments on commit 2591d4c

Please sign in to comment.