aboutsummaryrefslogtreecommitdiff
path: root/mobile/components/GreetingPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'mobile/components/GreetingPage.js')
-rw-r--r--mobile/components/GreetingPage.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/mobile/components/GreetingPage.js b/mobile/components/GreetingPage.js
index 5e6d502..9d1d410 100644
--- a/mobile/components/GreetingPage.js
+++ b/mobile/components/GreetingPage.js
@@ -14,7 +14,7 @@ export default class GreetingPage extends Component {
componentWillMount() {
if (Platform.OS === 'android' && !Constants.isDevice) {
this.setState({
- errorMessage: 'Oops, this will not work on Sketch in an Android emulator. Try it on your device!',
+ errorMessage: 'This will not work on an android device',
});
} else {
this._getLocationAsync();
@@ -33,19 +33,13 @@ export default class GreetingPage extends Component {
this.setState({ location });
};
- getCurrentLocation = () => {
-
- navigator.geolocation.getCurrentPosition(
- position => {
- this.recorded_coordinates = JSON.stringify([position.coords.latitude, position.coords.longitude]);
- },
- );
- }
-
moveToFormPage = () => {
this._getLocationAsync;
- const coordinates = [this.state.location.coords.longitude, this.state.location.coords.latitude]
- // Alert.alert(JSON.stringify(coordinates));
+ if (this.state.location === null) {
+ Alert.alert("There was a problem accessing your location");
+ return;
+ }
+ const coordinates = [this.state.location.coords.longitude, this.state.location.coords.latitude];
this.props.navigation.navigate('FormPage', {coordinates : coordinates});
}