Browse Source

move cookie updating to the NPS component

gh-pages
Keviin Åberg Kultalahti 5 years ago
parent
commit
7879fdf7e5
  1. 2
      packages/builder/src/components/feedback/NPSFeedbackForm.svelte
  2. 7
      packages/builder/src/pages/builder/app/[application]/_layout.svelte

2
packages/builder/src/components/feedback/NPSFeedbackForm.svelte

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

7
packages/builder/src/pages/builder/app/[application]/_layout.svelte

@ -35,11 +35,6 @@
window.open(`/${application}`) window.open(`/${application}`)
} }
function feedbackSubmitted() {
userShouldPostFeedback = false
document.cookie = "feedbackSubmitted=true"
}
async function getPackage() { async function getPackage() {
const res = await get(`/api/applications/${application}/appPackage`) const res = await get(`/api/applications/${application}/appPackage`)
const pkg = await res.json() const pkg = await res.json()
@ -116,7 +111,7 @@
{/await} {/await}
{#if userShouldPostFeedback} {#if userShouldPostFeedback}
<NPSFeedbackForm on:submitted={feedbackSubmitted} /> <NPSFeedbackForm on:submitted={() => (userShouldPostFeedback = false)} />
{/if} {/if}
<style> <style>

Loading…
Cancel
Save