Skip to content

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Nov 8, 2016

While testing, I noticed that I would be asked to wait before closing the panel after completing the walkthrough. At first it seemed to be a firefox-specific issue, but really it's just that the data wasn't finished saving. If I click "Stay on page", the spinner stay on-screen, and blocks my way to try closing the panel again.

This PR adds a new function afterSavingData, which lets you pass through a callback to be run once all the data is saved - immediately if nothing is waiting, or by checking every half-second.

This is used on both the Woo step, and before closing the panel. Otherwise there was the (probably small) possibility of users losing the last steps they've just set.

To test:

  • On a slower server (fake this by adding sleep( 3 ) to line 27 in class.jetpack-onboarding-end-points.php), run through the onboarding
  • Do some configuration, and get to the "Setup your store" step
  • Click the button, you should wait a little, while the data finishes saving
  • Eventually you should get to the woo step, with all your setup safely saved 😄

You can also test by not setting up WooCommerce, and instead walking through to the end. Closing the panel should also have you wait for a bit before reloading the page.

@ryelle ryelle added this to the Eventually milestone Nov 8, 2016
…which will prevent anyone from proceeding to Woo or closing the modal before all data is saved).
@ryelle ryelle force-pushed the fix/firefox-unload branch from 54c967b to 0a82d77 Compare November 8, 2016 17:43
@ryelle ryelle changed the base branch from master to update/packages-build November 8, 2016 17:43
@ryelle ryelle changed the base branch from update/packages-build to master November 8, 2016 18: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.

1 participant