Skip to content

Commit 083292c

Browse files
committed
Hide residence button after selecting place
1 parent 422a043 commit 083292c

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

app/mobile/screens/steps/ResidenceStep.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ export default function ResidenceStep(props) {
4343
})
4444
.then(place => {
4545
let casePlace = new CasePlace(place.placeID);
46+
try {
47+
for (let component of place.addressComponents) {
48+
for (let type of component.types) {
49+
if (type === "country") {
50+
casePlace.region = component.shortName
51+
}
52+
}
53+
}
54+
} catch (err) {
55+
// send error to log file
56+
}
57+
4658
casePlace.latitude = place.location.latitude;
4759
casePlace.longitude = place.location.longitude;
4860
casePlace.place_name = place.address;
@@ -87,15 +99,14 @@ export default function ResidenceStep(props) {
8799
/>
88100
</Card>
89101
) : (
90-
false
91-
)}
92-
<Button
102+
<Button
93103
mode="outlined"
94104
style={styles.actionButton}
95105
labelStyle={styles.actionButtonLabel}
96106
onPress={() => openPlacesSearchModal()}>
97107
{t('report.residence.pickPlace')}
98108
</Button>
109+
)}
99110
</StepContainer>
100111
);
101112
}

0 commit comments

Comments
 (0)