Next.js Discord

Discord Forum

Having trouble with a button that has 2 server actions associated with it in a toggle behavior

Unanswered
Dan posted this in #help-forum
Open in Discord
DanOP
So I have a button. When clicking it, it should trigger one server action and when I click it again, it will trigger the other server action. I am having an issue with it not triggering the proper server action properly if the button is pressed consecutively some what fast (like within 1 seconds). On local, it works fine, but it's an issue when deployed on Vercel.

First of all, I don't know why it's even like that, but yea I'm not really sure how to fix this.

Here's some screen shots

https://i.imgur.com/2Vfb0MO.png
https://i.imgur.com/EyHVHL2.png
https://i.imgur.com/3mw2ENn.png

0 Replies