move cookie updating to the NPS component

This commit is contained in:
Keviin Åberg Kultalahti 2021-07-21 12:36:04 +02:00
parent 6aa3ad03e2
commit 60b17594f5
2 changed files with 3 additions and 6 deletions

View File

@ -43,6 +43,8 @@
comment,
})
document.cookie = "feedbackSubmitted=true"
dispatch("submitted")
}
</script>

View File

@ -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}
<NPSFeedbackForm on:submitted={feedbackSubmitted} />
<NPSFeedbackForm on:submitted={() => (userShouldPostFeedback = false)} />
{/if}
<style>