From 1fe7d049a3731b0d758ad53a24814d3286c365ab Mon Sep 17 00:00:00 2001 From: Juuso Date: Fri, 23 Feb 2024 09:00:58 +0200 Subject: [PATCH] Moved message to proper place --- frontend/src/pages/survey/result.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/survey/result.jsx b/frontend/src/pages/survey/result.jsx index 5c7e6a67..0de9351b 100644 --- a/frontend/src/pages/survey/result.jsx +++ b/frontend/src/pages/survey/result.jsx @@ -153,11 +153,6 @@ const Home = () => { const fullResults = await getFullResults(store.userToken) store.setDetailedResults(fullResults) setFullResultsLoaded(true) - const message = { - results: store.detailedResults, - notification: "Success" - }; - window.parent.postMessage(message, '*') } catch (error) { console.error(error) } @@ -165,6 +160,11 @@ const Home = () => { }, []) if (store.industries.length !== 0 && fullResultsLoaded) { + const message = { + results: store.detailedResults, + notification: "Success" + } + window.parent.postMessage(message, '*') maxPoints = store.detailedResults.surveyResult.maxPoints userPoints = store.detailedResults.surveyResult.userPoints text = store.detailedResults.surveyResult.text