|
@@ -60,13 +60,19 @@ class Root extends Component {
|
60
|
60
|
// have precedence.
|
61
|
61
|
if (typeof this.props.url === 'undefined') {
|
62
|
62
|
Linking.getInitialURL()
|
63
|
|
- .then(url => this.setState({ url }))
|
|
63
|
+ .then(url => {
|
|
64
|
+ if (typeof this.state.url === 'undefined') {
|
|
65
|
+ this.setState({ url });
|
|
66
|
+ }
|
|
67
|
+ })
|
64
|
68
|
.catch(err => {
|
65
|
69
|
console.error('Failed to get initial URL', err);
|
66
|
70
|
|
67
|
|
- // Start with an empty URL if getting the initial URL fails;
|
68
|
|
- // otherwise, nothing will be rendered.
|
69
|
|
- this.setState({ url: null });
|
|
71
|
+ if (typeof this.state.url === 'undefined') {
|
|
72
|
+ // Start with an empty URL if getting the initial URL
|
|
73
|
+ // fails; otherwise, nothing will be rendered.
|
|
74
|
+ this.setState({ url: null });
|
|
75
|
+ }
|
70
|
76
|
});
|
71
|
77
|
}
|
72
|
78
|
}
|