Skip to content

Commit

Permalink
sonar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash committed Jun 25, 2024
1 parent eed12a0 commit 7048cfb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions server/models/views/alerts-and-warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ class ViewModel {
floodRiskUrl: config.floodRiskUrl
})

const pageTitle = place?.name ?? location
if (this.station && this.station.agency_name) {
this.pageTitle = `${this.station.agency_name} - flood alerts and warnings`
} else {
const pageTitle = place?.name ?? location

this.pageTitle = `${pageTitle ? pageTitle + ' - f' : 'F'}lood alerts and warnings`
}

if (error) {
this.pageTitle = 'Sorry, there is currently a problem searching a location'
} else {
if (this.station && this.station.agency_name) {
this.pageTitle = `${this.station.agency_name} - flood alerts and warnings`
} else {
this.pageTitle = `${pageTitle ? pageTitle + ' - f' : 'F'}lood alerts and warnings`
}
}

this.countFloods = floods?.floods?.length ?? 0
this.floods = floods?.groups?.map(item => item)

Expand Down

0 comments on commit 7048cfb

Please sign in to comment.