From 9532e056a03ef33664a29019160148c1ed0f41a3 Mon Sep 17 00:00:00 2001 From: Juuso Date: Mon, 12 Feb 2024 09:25:33 +0200 Subject: [PATCH] switched message to correct place --- frontend/src/pages/survey/questions/summary.jsx | 5 ----- frontend/src/pages/survey/result.jsx | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/survey/questions/summary.jsx b/frontend/src/pages/survey/questions/summary.jsx index d5c91bfa..3c8224e3 100644 --- a/frontend/src/pages/survey/questions/summary.jsx +++ b/frontend/src/pages/survey/questions/summary.jsx @@ -143,11 +143,6 @@ 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) { diff --git a/frontend/src/pages/survey/result.jsx b/frontend/src/pages/survey/result.jsx index 1cde6e2b..5c7e6a67 100644 --- a/frontend/src/pages/survey/result.jsx +++ b/frontend/src/pages/survey/result.jsx @@ -153,6 +153,11 @@ 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) }