mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-31 09:08:48 +08:00
[ReactNative] Replace console.error with alert on UIExplorer Geolocation example
Summary: @public The alert is less aggressive, otherwise it seems like the app is broken. Test Plan: Run the UIExplorer, open the Geolocation example and deny access. It should alert instead of redbox'ing
This commit is contained in:
@@ -50,8 +50,8 @@ var GeolocationExample = React.createClass({
|
||||
componentDidMount: function() {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(initialPosition) => this.setState({initialPosition}),
|
||||
(error) => console.error(error),
|
||||
{enableHighAccuracy: true, timeout: 100, maximumAge: 1000}
|
||||
(error) => alert(error.message),
|
||||
{enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}
|
||||
);
|
||||
this.watchID = navigator.geolocation.watchPosition((lastPosition) => {
|
||||
this.setState({lastPosition});
|
||||
|
||||
Reference in New Issue
Block a user