Skip to content

Commit

Permalink
feat: update My Locations [PT-188059223] [PT-188071551]
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanik committed Aug 8, 2024
1 parent b9e650e commit 3956658
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/grasp-seasons/components/my-locations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ export default class MyLocations extends Component<IProps> {

getOptions() {
const { locations } = this.props;
const options = this.selectedCity === "" ? [
const options = this.selectedLocation === "" ? [
<option key="unsaved" value="" disabled={true}>Custom Location (unsaved)</option>
] : [];
for (let i = 0; i < locations.length; i++) {
const loc = locations[i];
options.push(<option key={i} value={i}>{ loc.name }</option>);
options.push(<option key={i} value={i}>{ loc.name || `(${loc.latitude}, ${loc.longitude})` }</option>);
}
return options;
}

get selectedCity() {
get selectedLocation() {
const { lat, long, locations } = this.props;
const currentLocation: ILocation = { latitude: lat, longitude: long, name: "" };
for (let i = 0; i < locations.length; i++) {
Expand All @@ -54,7 +54,7 @@ export default class MyLocations extends Component<IProps> {
return (
<div className="my-locations">
<label>{ t("~MY_LOCATIONS", this.props.lang) }</label>
<select className="form-control" value={this.selectedCity} onChange={this.selectChange}>
<select className="form-control" value={this.selectedLocation} onChange={this.selectChange}>
{ this.getOptions() }
</select>
</div>
Expand Down

0 comments on commit 3956658

Please sign in to comment.