Skip to content
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

Merged
merged 3 commits into from
Mar 22, 2018

Conversation

radko93
Copy link
Contributor

@radko93 radko93 commented Mar 16, 2018

Small PR as everything is in the issue - fixes #3137

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.

@apollo-cla
Copy link

@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/

@apollo-cla
Copy link

apollo-cla commented Mar 16, 2018

Warnings
⚠️

There are library changes, but not tests. That's OK as long as you're refactoring existing code

Messages
📖

Please add your name and email to the AUTHORS file (optional)

Generated by 🚫 dangerJS

Copy link
Contributor

@peggyrayzis peggyrayzis left a 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?

@radko93
Copy link
Contributor Author

radko93 commented Mar 20, 2018

@peggyrayzis done, thanks!

@peggyrayzis peggyrayzis merged commit dde2c9c into apollographql:master Mar 22, 2018
@radko93 radko93 deleted the patch-1 branch March 22, 2018 08:35
@@ -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) {

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)```

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigator on React Native is undefined
5 participants