Merge pull request #2117 from crazyserver/MOBILE-3131
MOBILE-3131 signup: Propagate country from age verificationmain
commit
4634e5e0ea
|
@ -52,6 +52,7 @@ export class CoreLoginEmailSignupPage {
|
||||||
// Data for age verification.
|
// Data for age verification.
|
||||||
ageVerificationForm: FormGroup;
|
ageVerificationForm: FormGroup;
|
||||||
countryControl: FormControl;
|
countryControl: FormControl;
|
||||||
|
signUpCountryControl: FormControl;
|
||||||
isMinor = false; // Whether the user is minor age.
|
isMinor = false; // Whether the user is minor age.
|
||||||
ageDigitalConsentVerification: boolean; // Whether the age verification is enabled.
|
ageDigitalConsentVerification: boolean; // Whether the age verification is enabled.
|
||||||
supportName: string;
|
supportName: string;
|
||||||
|
@ -110,7 +111,8 @@ export class CoreLoginEmailSignupPage {
|
||||||
*/
|
*/
|
||||||
protected completeFormGroup(): void {
|
protected completeFormGroup(): void {
|
||||||
this.signupForm.addControl('city', this.fb.control(this.settings.defaultcity || ''));
|
this.signupForm.addControl('city', this.fb.control(this.settings.defaultcity || ''));
|
||||||
this.signupForm.addControl('country', this.fb.control(this.settings.country || ''));
|
this.signUpCountryControl = this.fb.control(this.settings.country || '');
|
||||||
|
this.signupForm.addControl('country', this.signUpCountryControl);
|
||||||
|
|
||||||
// Add the name fields.
|
// Add the name fields.
|
||||||
for (const i in this.settings.namefields) {
|
for (const i in this.settings.namefields) {
|
||||||
|
@ -333,6 +335,10 @@ export class CoreLoginEmailSignupPage {
|
||||||
|
|
||||||
this.wsProvider.callAjax('core_auth_is_minor', params, {siteUrl: this.siteUrl}).then((result) => {
|
this.wsProvider.callAjax('core_auth_is_minor', params, {siteUrl: this.siteUrl}).then((result) => {
|
||||||
if (!result.status) {
|
if (!result.status) {
|
||||||
|
if (this.countryControl.value) {
|
||||||
|
this.signUpCountryControl.setValue(this.countryControl.value);
|
||||||
|
}
|
||||||
|
|
||||||
// Not a minor, go ahead!
|
// Not a minor, go ahead!
|
||||||
this.ageDigitalConsentVerification = false;
|
this.ageDigitalConsentVerification = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue