Skip to content

Commit 669f30e

Browse files
committed
Use region from selected place
1 parent 3e2cc37 commit 669f30e

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

app/mobile/screens/steps/PhoneNumberStep.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,25 @@ export default function PhoneNumberStep(props) {
147147

148148
const getCountryCode = () => {
149149
var countryCode = null;
150+
150151
try {
151-
countryCode = RNLocalize.getCountry();
152+
countryCode = props.caseReport.residence.region;
152153
} catch {
153-
countryCode = DEFAULT_COUNTRY_CODE;
154+
// do nothiing
154155
}
155156

156-
if (countryCode == null) {
157-
countryCode = DEFAULT_COUNTRY_CODE;
158-
}
157+
if (!countryCode) {
158+
try {
159+
countryCode = RNLocalize.getCountry();
160+
} catch {
161+
countryCode = DEFAULT_COUNTRY_CODE;
162+
}
159163

164+
if (countryCode == null) {
165+
countryCode = DEFAULT_COUNTRY_CODE;
166+
}
167+
}
168+
160169
return countryCode.toLowerCase();
161170
};
162171

@@ -171,8 +180,9 @@ export default function PhoneNumberStep(props) {
171180
hideNextButton={props.hideNextButton}
172181
hideBackButton={props.hideBackButton}>
173182
<View>
174-
175-
<Caption style={{fontSize: 13, marginTop: -10, marginBottom: 10}}>{t("report.phoneNumber.helpText")}</Caption>
183+
<Caption style={{fontSize: 13, marginTop: -10, marginBottom: 10}}>
184+
{t('report.phoneNumber.helpText')}
185+
</Caption>
176186
{!isVerified ? (
177187
<View>
178188
{!isPhoneNumberEntered ? (

0 commit comments

Comments
 (0)