forked from rDrama/rDrama
1
0
Fork 0
rDrama/files/routes
TLSM d1e2926ca3 Fix comment self-upvote removal UI bug. (#236)
Fixes minor UI bug when removing self-upvote on a comment. Previous
behavior, starting from a new comment:
    - Initial state: score 1 from self-upvote, upvote button shows
      highlighted as `color: var(--primary)`.
    - Click on upvote button to remove self-upvote → button
      unhighlights, score displays as 0.
    - [reload page]
    - Score displays as 0, but button is highlighted.
    - Click on upvote button → button unhighlights, score displays
      as -1. [If you reload the page now, state is score 0 &
      highlighted; no change in serverside votes.]
    - Click on upvote again → button highlights, score displays as 0.
    - [reload page]
    - Score displays as 1, button is highlighted.
Direct cause is `templates/comments.html @ L115-117`. I checked
`api_comment`, though, and it adds a vote on new comments, and that
state change propagates to the template's parameters before it renders,
so I believe the only time this triggers is specifically when a user
has removed their self-upvote. Bug is fixed when testing with L115-117
removed. Is there some other edge case it was meant to solve?

Secondary bugfix: Removing a self-upvote _costs_ you a coin & a
truescore point. I think this is one of the few ways to get negative
dramacoin. I chose to fix it by having self-votes and self-unvotes not
change coins/truecoins. The alternative of having new comments & posts
give the user +1 coin/truecoin would modify site behavior, and you'd
retroactively owe some powerusers thousands of DC & truescore.
2022-05-02 20:12:28 +02:00
..
__init__.py what a mess 2022-03-24 21:44:12 +02:00
admin.py sfd 2022-05-01 23:44:38 +02:00
awards.py fsdfds 2022-04-22 15:23:56 +02:00
chat.py dfs 2022-04-26 02:38:52 +02:00
comments.py sfd 2022-05-01 23:48:53 +02:00
discord.py Revert "vxc" 2022-04-25 23:59:12 +02:00
errors.py sfd 2022-05-01 23:48:53 +02:00
feeds.py fsd 2022-05-01 02:53:24 +02:00
front.py sfd\ 2022-05-02 20:07:17 +02:00
giphy.py closing2 2022-01-11 23:54:41 +02:00
login.py hg 2022-04-20 19:13:27 +02:00
oauth.py fds 2022-04-17 22:20:40 +02:00
posts.py sdf 2022-05-02 00:28:51 +02:00
reporting.py fds 2022-04-23 00:48:01 +02:00
search.py fds 2022-04-18 20:45:18 +02:00
settings.py sfd 2022-05-01 23:48:53 +02:00
static.py 6yutg 2022-05-02 04:11:01 +02:00
subs.py sfd 2022-05-01 23:48:53 +02:00
users.py sfd 2022-05-01 23:44:38 +02:00
votes.py Fix comment self-upvote removal UI bug. (#236) 2022-05-02 20:12:28 +02:00