Disable upvote functionality for unsigned user

Words
361
Reading
2 min
Listen
Play
9y

utopian.png

Expected behavior

A new user or unsigned user who visit utopian.io is able to see the list of contributions along with the details of upvotes, comments. When the click on upvote or comments icon it shouldn't respond or redirect them to login, since they are still a new or unsigned user. Once they sign in to utopian.io we should allow them to upvote, comment or any other action which is common/allowed.

Actual behavior

Currently, when a user is not signed-in they must not be allowed to upvote. Contributions can still be shown. As of now, when a user clicks on the upvote icon, a slider is shown for percentage voting from 0-100, the message below(which calculates the vote worth) says "Your vote will be worth NaN." which is not a good behavior. We should avoid showing the slider along with 'confirm' link and message, this is applicable only if the user is not signed in.

There is no point in showing slider and 'confirm' link, when they click on 'confirm' nothing happens, not a even error message which will inform the user that they must be signed in.

When the user clicks on 'comment' then the page gets redirected to the post page where they see the details of the post and comments but the option to add comment is disabled. In first place, we should not allow any functionality on click on comment icon. The page should not be redirected, unless the user has signed-in.

The screen recording of the issue can be found in below section.

How to reproduce

Steps to reproduce are simple, as follows,

  1. Visit https://utopian.io/ in incognito mode or signout(if already signed in)
  2. Click on 'upvote' icon in any of the contribution list. A vote slider will be shown(which is an expected behavior)
  3. Click on 'comment' icon, the page will be redirected to the post.(which is actually not required)
  • Browser: Chrome v63
  • Operating system: Windows 7

Recording Of The Bug

utopian-bug.gif

Potential Fixes

  1. Do not allow any functionality on click on 'upvote' & 'comment' icon if the user is not registered/unsigned.
  2. Display appropriate error message



Posted on Utopian.io - Rewarding Open Source Contributors

Disable upvote functionality for unsigned user | Ecency