-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix navigator undefined on React Native #3164
Conversation
@radko93: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this fix! 🎉 Before I merge, can you please add an entry to the Changelog with a link to the PR?
@peggyrayzis done, thanks! |
@@ -167,7 +167,7 @@ export default class ApolloClient<TCacheShape> implements DataProxy { | |||
typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' | |||
) { | |||
// Only for Chrome | |||
if (navigator.userAgent.indexOf('Chrome') > -1) { | |||
if (window.navigator && window.navigator.userAgent.indexOf('Chrome') > -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not solved. I still receive error in RN.
It should be
if (window &&
window.navigator &&
window.navigator.userAgent &&
window.navigator.userAgent.indexOf('Chrome') > -1)```
Small PR as everything is in the issue - fixes #3137
Checklist: