Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clap count in UI is increment while the update is rejected by server #57

Open
prabhu43 opened this issue Jul 7, 2020 · 4 comments
Open

Comments

@prabhu43
Copy link

prabhu43 commented Jul 7, 2020

Once a user clap for second time after page refresh, It increments the count in UI.
But the update api call does not increase the count as the clap limit exceeded for the user from that IP, it returns the same old value for clap count.

Expected:

If the clap limit exceeded for the user(source ip), disable the button on initialisation(page refresh)

Solutions:

  1. Update the count in UI after getting response from updateClaps api call
  2. Disable applause button by adding "clap-limit-exceeded" class on initialisation(page refresh)
@prabhu43
Copy link
Author

prabhu43 commented Jul 7, 2020

@ColinEberhardt Let me know which solution is preferable. I can fix this issue.

@android10
Copy link

android10 commented Jan 8, 2021

Any update on this one?

I opened another issue probably related to this one due to the introduction of clap-limit-exceeded

Here is the link: #69

Thanks for such a great job @ColinEberhardt ❤️

@ColinEberhardt
Copy link
Owner

Thanks for the suggestions - this is a tricky issue, and one that always has an element of compromise. I've made a recent update that works as follows:

  1. I've added some styling for the clap-count-exceeded state so that it is visible to the user 7d346ef
  2. When the clap increment is sent to the server, the code now checks the returned value to see if an increment has actually taken place. If not, the clap-count-exceeded style is applied, and the clap count reset to the server-side value eed48b8

This does result in some behaviour that users might find unexpected:

  1. If they have reached their (IP specific) clap limit, refresh the page, then click the button, the UI will register the update - but 2 seconds later, the button will gray-out and reset the counter value. People might find this confusing.
  2. In multi-clap mode, the user can only send one 'multi clap burst' of claps. If they, for example, clap 3 times in quick succession, pause, then clap another 3 times, only the first 3 will register.

@android10
Copy link

@ColinEberhardt thanks for taking care of this! Amazing job! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants