Skip to content

Commit 08fa33b

Browse files
committed
Fix #5354
1 parent bf6842b commit 08fa33b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/shared/containers/Gigs/RecruitCRMJobs.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const sortByOptions = [
2121
{ label: 'Latest Updated Descending', selected: false },
2222
];
2323
// Locations
24-
let locations = [];
24+
let locations = [{
25+
label: 'All', selected: true,
26+
}];
2527

2628
class RecruitCRMJobsContainer extends React.Component {
2729
constructor(props) {
@@ -123,12 +125,15 @@ class RecruitCRMJobsContainer extends React.Component {
123125
jobsToDisplay = _.filter(jobs, (job) => {
124126
const country = job.country === 'Anywhere' || job.country === 'Any' ? 'All' : job.country;
125127
// build dropdown
126-
const found = _.find(locations, { label: country });
127-
if (!found) {
128+
const found = _.findIndex(locations, { label: country });
129+
if (found === -1) {
128130
locations.push({
129131
label: country, selected: location.toLowerCase() === country.toLowerCase(),
130132
});
133+
} else {
134+
locations[found].selected = location.toLowerCase() === country.toLowerCase();
131135
}
136+
locations[0].selected = location === 'All';
132137
// filter
133138
if (location === 'Anywhere' || location === 'Any' || location === 'All') return true;
134139
return location.toLowerCase() === job.country.toLowerCase();

0 commit comments

Comments
 (0)