Skip to content

Commit

Permalink
feat(iframeFormation): add src and height in postMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanngab committed Dec 16, 2024
1 parent 38cd015 commit e3b852f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ui/src/iframes/IframeFormationPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,27 @@ const IframeFormationPage = () => {

useEffect(() => {
if (isSuccess) {
window.parent.postMessage({ siriusHeight: document.body.scrollHeight + 50 }, "*");
window.parent.postMessage(
{
src: window.location.href,
height: document.body.scrollHeight,
siriusHeight: document.body.scrollHeight + 50,
},
"*"
);
}
}, [isSuccess]);

useEffect(() => {
const handleResize = () => {
window.parent.postMessage({ siriusHeight: document.body.scrollHeight + 50 }, "*");
window.parent.postMessage(
{
src: window.location.href,
height: document.body.scrollHeight,
siriusHeight: document.body.scrollHeight + 50,
},
"*"
);
};

document.addEventListener("click", handleResize);
Expand Down

0 comments on commit e3b852f

Please sign in to comment.