Skip to content

Commit

Permalink
fixed problem that would not close the redirect iframe after clicking…
Browse files Browse the repository at this point in the history
… the back button on safari #5113
  • Loading branch information
leonardola committed Nov 15, 2022
1 parent 829ed87 commit 87a3653
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/checkout/platform-checkout/email-input-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,13 @@ export const handlePlatformCheckoutEmailInput = async (
}
} );

window.addEventListener( 'pageshow', function ( event ) {
if ( event.persisted ) {
// Safari needs to close iframe with this.
closeIframe( false );
}
} );

if ( ! customerClickedBackButton ) {
// Check if user already has a WooPay login session.
if ( ! hasCheckedLoginSession ) {
Expand Down

0 comments on commit 87a3653

Please sign in to comment.