Skip to content

Commit

Permalink
chore: slight code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hoorayimhelping committed Feb 24, 2020
1 parent 87a37cc commit 98750c4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions ui/src/timeMachine/components/TagSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,10 @@ const mstp = (state: AppState, ownProps: OwnProps): StateProps => {

const tags = getActiveQuery(state).builderConfig.tags

let emptyText: string
let emptyText: string = ''
const previousTagSelector = tags[ownProps.index - 1]
if (
ownProps.index === 0 ||
!previousTagSelector ||
!previousTagSelector.key
) {
emptyText = ''
} else {
emptyText = `Select a ${tags[ownProps.index - 1].key} value first`
if (previousTagSelector && previousTagSelector.key) {
emptyText = `Select a ${previousTagSelector.key} value first`
}

const {
Expand Down

0 comments on commit 98750c4

Please sign in to comment.