starting async functionality...completed mysql rest for the most part
- need to handle longitude and latitude queries
This commit is contained in:
+11
-2
@@ -26,8 +26,7 @@ export default class Loading extends Component<Props> {
|
||||
this.latitude = parseFloat(position.coords.latitude);
|
||||
this.longitude = parseFloat(position.coords.longitude);
|
||||
console.log(String(this.latitude) + ' ' + String(this.longitude));
|
||||
//AsyncStorage.setItem('longitude', this.longitude);
|
||||
//AsyncStorage.setItem('latitude', this.latitude);
|
||||
this.storeValues();
|
||||
Actions.main();
|
||||
},
|
||||
(error) => console.log(error),
|
||||
@@ -38,6 +37,16 @@ export default class Loading extends Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
storeValues = async () => {
|
||||
try {
|
||||
await AsyncStorage.setItem('long', this.longitude);
|
||||
await AsyncStorage.setItem('lat', this.latitude);
|
||||
console.log('Stored Values!');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={loadingStyles.container}>
|
||||
|
||||
Reference in New Issue
Block a user