Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Sep 11, 2024
1 parent 6f63bc0 commit 349b05f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ function iframeListener(event) {
// the message format would break backwards compatibility.
const retCode = messageData.type in { true: 1, false: 1, undefined: 1 }

if (retCode) log(iframeId, 'Ignoring init message from meta parent page')
if (retCode) {
log(iframeId, 'Ignoring init message from meta parent page')
}

return retCode
}
Expand Down Expand Up @@ -743,11 +745,11 @@ function setSize(messageData) {
function setDimension(dimension) {
const size = `${messageData[dimension]}px`
messageData.iframe.style[dimension] = size
log(iframeId, `IFrame (${iframeId}) ${dimension} set to ${size}`)
log(id, `IFrame (${id}) ${dimension} set to ${size}`)
}

const iframeId = messageData.id
const { sizeHeight, sizeWidth } = settings[iframeId]
const { id } = messageData
const { sizeHeight, sizeWidth } = settings[id]

if (sizeHeight) setDimension('height')
if (sizeWidth) setDimension('width')
Expand Down

0 comments on commit 349b05f

Please sign in to comment.