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

Adding navigator.userAgent to our globals to solve a crash #1195

Merged

Conversation

etoledom
Copy link
Contributor

@etoledom etoledom commented Jul 4, 2019

This PR solves a crash updating the gutenberg ref to master.

The crashing code was introduced here: https://github.com/WordPress/gutenberg/pull/16065/files
This line in particular: https://github.com/WordPress/gutenberg/blob/3279e116b9486099a681282a7aae050c96f563c6/packages/compose/src/hooks/use-reduced-motion/index.js#L11

The crash:

IMG_2271

This PR also brings the gutenberg ref up to date with gutenberg master.

To test:

  • Try to reproduce the error:
    • Check out develop
    • Update the gutenberg ref to master
    • A red screen should appear
  • Check out this branch
  • Run the app.
  • Check that it doesn't crash.

@etoledom etoledom added this to the 1.9 milestone Jul 4, 2019
@etoledom etoledom requested a review from pinarol July 4, 2019 16:14
@etoledom etoledom self-assigned this Jul 4, 2019
@etoledom etoledom requested review from marecar3 and removed request for pinarol July 4, 2019 17:14
Copy link
Contributor

@marecar3 marecar3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @etoledom!
LGTM! 👍

@etoledom
Copy link
Contributor Author

etoledom commented Jul 4, 2019

Thank you @marecar3 !

Let's merge this as a fast fix of this crash. Later on we can implement a proper mobile version of useReducedMotion as discussed here: WordPress/gutenberg#16065 (review)

@etoledom etoledom merged commit ef09049 into develop Jul 4, 2019
@etoledom etoledom deleted the issue/fix-window-navigator-useragent-indexof-crash branch July 4, 2019 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants