Skip to content

Commit 38142e4

Browse files
committed
correct cons description
1 parent f7fd5ad commit 38142e4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/contractors/Contractors.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ class Contractors extends Component {
117117
}
118118

119119
render () {
120-
let description = ''
121120
const con_count = this.state.contractor_response && this.state.contractor_response.count
122121
const location_pretty = (
123122
this.state.contractor_response &&
124123
this.state.contractor_response.location &&
125124
this.state.contractor_response.location.pretty
126125
)
127126

127+
let description = ''
128128
if (con_count) {
129129
const description_prefix = []
130130
if (location_pretty) {
@@ -133,10 +133,12 @@ class Contractors extends Component {
133133
if (this.state.selected_subject) {
134134
description_prefix.push(this.state.selected_subject.name)
135135
}
136-
description = this.props.root.get_text('filter_summary_' + (con_count === 1 ? 'single' : 'plural'), {
137-
count: con_count,
138-
prefix: description_prefix.join('; '),
139-
})
136+
if (description_prefix.length > 0) {
137+
description = this.props.root.get_text('filter_summary_' + (con_count === 1 ? 'single' : 'plural'), {
138+
count: con_count,
139+
prefix: description_prefix.join('; '),
140+
})
141+
}
140142
}
141143
const DisplayComponent = this.props.config.mode === 'grid' ? Grid : List
142144
return (

0 commit comments

Comments
 (0)