From c16c43f2d444f4ca1a9cc7f519ec44d22287ce50 Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 17 Jul 2024 03:57:15 -0400 Subject: [PATCH] Change if/else on checking if end-user is subscribed --- src/pages/creator/C6nSFpj9HTCZ5t-N3Rm3-HA.astro | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/creator/C6nSFpj9HTCZ5t-N3Rm3-HA.astro b/src/pages/creator/C6nSFpj9HTCZ5t-N3Rm3-HA.astro index da76079..89f20ee 100644 --- a/src/pages/creator/C6nSFpj9HTCZ5t-N3Rm3-HA.astro +++ b/src/pages/creator/C6nSFpj9HTCZ5t-N3Rm3-HA.astro @@ -10,13 +10,19 @@ let { data: subs } = await supabase .select("*") .eq('UserSubscribed', id) .eq('Id', CreatorId) + +if (subs[0] === undefined) { + var Subbed = false +} else { + var Subbed = true +} ---

Vsause

- {subs[0].Subscribed ? + {Subbed ? Unsubscribe : Subscribe