broology / poker-moons

Free online poker with friends without the hassle.
4 stars 3 forks source link

feat(frontend buttons): add loading states to api actions to prevent double actions #262

Closed jordems closed 1 year ago

jordems commented 1 year ago

Proposed Changes

Adds loading states to table related api actions on the frontend. This allows us to disable the button after a request is initiated, preventing a user from double clicking a button and performing it twice when it is only intended to happen once.

I ended up doing it on a per api call basis in the table state, I'm sure there is probably a more elegant solution that exists in the world, but this fits our project.

Didn't end up adding the loader icon, as fa-icons doesn't support gifs for free. But the actions load fast enough that I don't think it is necessary tbh.

Linked Issue

resolves #259

Types of changes

Merge Checklist

Deployment Notes