prefix postMessage id with carbon:

main
Mike Fix 6 years ago
parent e45bbd8a25
commit f149e115d5

@ -61,10 +61,11 @@ class Embed extends React.Component {
updateCode = code => { updateCode = code => {
this.setState({ code }) this.setState({ code })
if (isInIFrame(window)) { const iFrame = isInIFrame(window)
window.parent.window.parent.postMessage( if (iFrame) {
iFrame.postMessage(
{ {
id: this.state.id || 'carbon', id: this.state.id ? `carbon:${this.state.id}` : 'carbon',
code code
}, },
'*' '*'

Loading…
Cancel
Save