From 7879fdf7e59e61898410cc9540300436df5cd674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Wed, 21 Jul 2021 12:36:04 +0200 Subject: [PATCH] move cookie updating to the NPS component --- .../builder/src/components/feedback/NPSFeedbackForm.svelte | 2 ++ .../src/pages/builder/app/[application]/_layout.svelte | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/feedback/NPSFeedbackForm.svelte b/packages/builder/src/components/feedback/NPSFeedbackForm.svelte index f181d59504..f9b1469ded 100644 --- a/packages/builder/src/components/feedback/NPSFeedbackForm.svelte +++ b/packages/builder/src/components/feedback/NPSFeedbackForm.svelte @@ -43,6 +43,8 @@ comment, }) + document.cookie = "feedbackSubmitted=true" + dispatch("submitted") } diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index efd68ab8dc..e2e9dcb40e 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -35,11 +35,6 @@ window.open(`/${application}`) } - function feedbackSubmitted() { - userShouldPostFeedback = false - document.cookie = "feedbackSubmitted=true" - } - async function getPackage() { const res = await get(`/api/applications/${application}/appPackage`) const pkg = await res.json() @@ -116,7 +111,7 @@ {/await} {#if userShouldPostFeedback} - + (userShouldPostFeedback = false)} /> {/if}