Skip to content

Commit

Permalink
Fixing code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad committed Jan 11, 2023
1 parent 2485e7f commit 5299c68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/src/features/hfiCalculator/components/DailyViewTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ export const DailyViewTable = (props: Props): JSX.Element => {
/>
</TableRow>
{sortBy(area.stations, station => station.order_of_appearance_in_planning_area_list).map(
(station, idx) => {
station => {
if (isUndefined(result)) {
return <React.Fragment key={`daily-undefined-result${idx}`}></React.Fragment>
return <React.Fragment key={`daily-undefined-result-${station.code}`}></React.Fragment>
}
const daily = getDailyForDay(station.code)
const selectedFuelType = getSelectedFuelType(
Expand All @@ -289,7 +289,7 @@ export const DailyViewTable = (props: Props): JSX.Element => {
props.fuelTypes
)
if (isUndefined(selectedFuelType)) {
return <React.Fragment key={`daily-undefined-fuel-type-${idx}`}></React.Fragment>
return <React.Fragment key={`daily-undefined-fuel-type-${station.code}`}></React.Fragment>
}
const grassCureError = !isValidGrassCure(daily, selectedFuelType)
const isRowSelected = !isUndefined(area) && stationCodeInSelected(area.id, station.code)
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/hfiCalculator/components/WeeklyViewTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const WeeklyViewTable = (props: Props): JSX.Element => {
/>
</TableRow>
{sortBy(area.stations, station => station.order_of_appearance_in_planning_area_list).map(
(station, idx) => {
station => {
const dailiesForStation = getDailiesByStationCode(result, station.code)
const isRowSelected = stationCodeInSelected(area.id, station.code)
const classNameForRow = !isRowSelected
Expand All @@ -201,7 +201,7 @@ export const WeeklyViewTable = (props: Props): JSX.Element => {
props.fuelTypes
)
if (isUndefined(selectedFuelType)) {
return <React.Fragment key={`weekly-undefined-fuel-type-${idx}`}></React.Fragment>
return <React.Fragment key={`weekly-undefined-fuel-type-${station.code}`}></React.Fragment>
}
return (
<TableRow className={classNameForRow} key={`station-${stationCode}`}>
Expand Down

0 comments on commit 5299c68

Please sign in to comment.