Skip to content

Fix country setting page #5606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ workflows:
branches:
only:
- free
- fix-country-setting-page
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand All @@ -368,7 +369,7 @@ workflows:
filters: &filters-staging
branches:
only:
- fix-env-value-issuer
- develop
# Production builds are exectuted
# when PR is merged to the master
# Don't change anything in this configuration
Expand Down
10 changes: 10 additions & 0 deletions src/shared/components/Settings/Profile/BasicInfo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ export default class BasicInfo extends ConsentComponent {
inputChanged: false,
});
}
if (nextProps.lookupData) {
const { countries } = nextProps.lookupData;
const { newBasicInfo } = this.state;
if (!newBasicInfo.country) {
const code = newBasicInfo.homeCountryCode || newBasicInfo.competitionCountryCode;
const { country } = countries.find(c => c.countryCode === code) || {};
newBasicInfo.country = country;
this.setState({ newBasicInfo });
}
}
}

onCheckFormValue(newBasicInfo) {
Expand Down