feat: adds prop update listening to modal browser zoid polyfill#1161
Merged
feat: adds prop update listening to modal browser zoid polyfill#1161
Conversation
48ed5aa to
ecf1a92
Compare
perco12
reviewed
Jan 21, 2025
Comment on lines
+21
to
+25
| const merchantOrigin = decodeURIComponent(initialProps.origin); | ||
|
|
||
| if (eventOrigin === merchantOrigin && eventName === 'PROPS_UPDATE' && newProps && typeof newProps === 'object') { | ||
| // send event ack so PostMessenger will stop reposting event | ||
| sendEventAck(id, merchantOrigin); |
Contributor
There was a problem hiding this comment.
I know we chatted about this internally, but I think we can go with
Suggested change
| const merchantOrigin = decodeURIComponent(initialProps.origin); | |
| if (eventOrigin === merchantOrigin && eventName === 'PROPS_UPDATE' && newProps && typeof newProps === 'object') { | |
| // send event ack so PostMessenger will stop reposting event | |
| sendEventAck(id, merchantOrigin); | |
| const clientOrigin = decodeURIComponent(initialProps.origin); | |
| if (eventOrigin === clientOrigin && eventName === 'PROPS_UPDATE' && newProps && typeof newProps === 'object') { | |
| // send event ack so PostMessenger will stop reposting event | |
| sendEventAck(id, clientOrigin); |
perco12
reviewed
Jan 21, 2025
src/components/modal/v2/lib/utils.js
Outdated
|
|
||
| export function sendEventAck(eventId, trustedOrigin) { | ||
| // skip this step if running in test env because jest's target windows don't support postMessage | ||
| if (window.process?.env?.NODE_ENV === 'test') { |
Contributor
There was a problem hiding this comment.
did we perhaps mean?
Suggested change
| if (window.process?.env?.NODE_ENV === 'test') { | |
| if (process.env.NODE_ENV === 'test') { |
perco12
approved these changes
Feb 4, 2025
Seavenly
approved these changes
Mar 26, 2025
…components into feature/DTCRCMERC-3611-modal-lander-v6
…components into feature/DTCRCMERC-3611-modal-lander-v6
|
🎉 This PR is included in version 1.68.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updates the modal lander to support communicating bi-directionally with the v6 modal wrapper
Screenshots
Testing instructions
feat: add learn more modal wrapper for messagesin an internal repo (DM Dan for more details).LearnMore.ts, and on line 52, append&stage_tag=merc3611_testto end of url query.