From ff1d0d609da40b9e9878ddd644e8ec952d005050 Mon Sep 17 00:00:00 2001 From: Joshua Lau Date: Sat, 6 Jul 2024 16:21:14 -0700 Subject: [PATCH] Update feedback message --- src/lib/components/general/Feedback.svelte | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lib/components/general/Feedback.svelte b/src/lib/components/general/Feedback.svelte index ac8a0228..2a6c82a8 100644 --- a/src/lib/components/general/Feedback.svelte +++ b/src/lib/components/general/Feedback.svelte @@ -5,6 +5,7 @@ import { toastStore } from "$lib/stores/toast"; import { EMAIL_LIST_FORM_LINK } from "$lib/constants"; import { getContext } from "svelte"; + import { goto } from "$app/navigation"; const supabase = getContext("supabase") as SupabaseClient; export let showModal: boolean = false; @@ -13,16 +14,23 @@ let isError: boolean = false; // Submit feedback to the database - const submitFeedback = () => { + const submitFeedback = async () => { if (feedback.trim() === "") { isError = true; return; } + const user = (await supabase.auth.getUser()).data.user; + if (!user) { + goto("/"); + return; + } + supabase .from("feedback") .insert({ - feedback: feedback.trim() + feedback: feedback.trim(), + user_id: user.id }) .then(() => { showModal = false; @@ -35,15 +43,15 @@

- We always love to hear any feedback about TigerJunction! - Anything at all is appreciated -- be it feature suggestions, - problems you face, or just your overall impressions. Thank you + We always love to hear any feedback about TigerJunction! Whether + positive or negative, please try to include details about what + you like or dislike so we can improve the platform. Thank you for being an essential part of this project!

- All feedback is anonymous. If you would like a response, please - write your email in the message. If you would like monthly - updates, please join our email list here