-
Notifications
You must be signed in to change notification settings - Fork 68
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
Prevent browser error on dispute evidence submission #9847
Prevent browser error on dispute evidence submission #9847
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +20 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
thanks @nagpai, that's unfortunate but no unexpected. I've refactored the change to work in all cases. Additionally I found that saving draft evidence still had the popup so I've added a fix for that as well. |
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.
Reviewed the code, tested it. The browser popup is not longer displayed after the fix. ✅
* develop: Remove payout timing notice and update the help tooltip. (#9812) Fix styling on payment details page in mobile view. (#9790) Prevent browser error on dispute evidence submission (#9847) Update inquiry order notes to use inquiry specific content (#9828) Restrict Stripe Link to credit card payment method and improve cleanup (#9822)
Fixes #9830
Changes proposed in this Pull Request
Successful dispute evidence submission causes the browser to navigate to refresh the page. This was triggering the browser alert due to a hook on
onbeforeunload
.This change ensures the evidence is reset before attempting to navigate away which prevents the browser alert.
It looks like this bug may have been introduced in #4458 when the browser navigation was introduced due to caching issues.
I chatted with @Jinksi about the best way to approach this change as there are a few improvements that could be made. For now, we agreed that the one-line fix approach is best. p1732845547215289-slack-C02BW3Z8SHK
Update: The one line fix did not work in all cases due to the way that react batches state updates async. This PR has been updated to handle this case and support both Submission and Saving of evidence.
Testing instructions
npm run changelog
to add a changelog file.Post merge