Skip to content

Commit

Permalink
additional messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Juustoisa committed Feb 12, 2024
1 parent 7cdca7b commit 2196dbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const Home = () => {
// store.resetVersion()
// eslint-disable-next-line no-undef
const resizeObserver = new ResizeObserver((entries) => {
window.parent.postMessage(entries[0].target.clientHeight + 200, '*')
const message = {height:entries[0].target.clientHeight + 200}
window.parent.postMessage(message, '*')
})

resizeObserver.observe(document.body)
Expand Down Expand Up @@ -165,6 +166,7 @@ const Home = () => {
}, [])

const handleClick = () => {
window.parent.postMessage('Started', '*')
router.push('/survey/questions/?id=1', null, {
shallow: true,
})
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/pages/survey/questions/summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ const Summary = () => {
)
store.setResults(response.results)
store.setUserToken(response.token)
const message = {
results: response.results,
notification: "Success"
};
window.parent.postMessage(message, '*')
router.push('/survey/result')

} catch (e) {
Expand Down

0 comments on commit 2196dbc

Please sign in to comment.