[RN] Use a more resilient way for testing if we are on React Native
navigator.product is read-only, so we don't run into the risk of it being changed.
This commit is contained in:
parent
4efbbe14b1
commit
1d90826098
|
@ -83,7 +83,7 @@ function _navigate({ dispatch, getState }) {
|
|||
// abstraction. Because of the first point, I'm leaving the second point
|
||||
// unresolved to attract attention to the fact that the following needs more
|
||||
// thinking.
|
||||
if (navigator.userAgent.match(/react[ \s-]*native/i)) {
|
||||
if (navigator.product === 'ReactNative') {
|
||||
// Create/destroy the local tracks as needed: create them the first time
|
||||
// we are going to render an actual route (be that the WelcomePage or
|
||||
// the Conference).
|
||||
|
|
|
@ -73,7 +73,7 @@ ReducerRegistry.register(
|
|||
*/
|
||||
function _getInitialState() {
|
||||
return (
|
||||
navigator.userAgent.match(/react[ \s-]*native/i)
|
||||
navigator.product === 'ReactNative'
|
||||
? INITIAL_RN_STATE
|
||||
: INITIAL_NON_RN_STATE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue