This article is a continuation of the article I wrote on the RLS policy issue I solved with Supabase.
After I had fixed the RLS policy issue, I discovered that the way I structured my code was wrong. Semantically, it looked sort of correct but it was logically wrong. Here's a live preview of the project so you get what I mean.
When a user clicks the "Join early access" button, a function called subscribeEmail() is fired. This initially didn't look like a problem as I only considered the fact that users will be clicking the button once when they want to sign up for the waitlist, I didn't take into account that users could click the button multiple times (This could have been avoided if I disable the button once they click on it), but even though I were to disable the button, if the user clicks on the button again after the disabled property is removed, I will still encounter the same issue.
Here's the code:
"use client";






