forked from rDrama/rDrama
![]() 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. |
||
---|---|---|
.. | ||
admin | ||
errors | ||
sub | ||
admins.html | ||
agendaposters.html | ||
api.html | ||
authforms.html | ||
award_modal.html | ||
badges.html | ||
ban_modal.html | ||
banned.html | ||
blocks.html | ||
changelog.html | ||
chat.html | ||
comments.html | ||
contact.html | ||
default.html | ||
delete_post_modal.html | ||
emoji_modal.html | ||
expanded_image_modal.html | ||
followers.html | ||
following.html | ||
forgot_password.html | ||
formatting.html | ||
gif_modal.html | ||
grassed.html | ||
header.html | ||
home.html | ||
home_comments.html | ||
journoid_banner.html | ||
leaderboard.html | ||
log.html | ||
login.html | ||
login_2fa.html | ||
lost_2fa.html | ||
marseys.html | ||
message.html | ||
message_success.html | ||
mine.html | ||
mobile_navigation_bar.html | ||
notifications.html | ||
oauth.html | ||
patrons.html | ||
post_actions.html | ||
post_actions_mobile.html | ||
post_admin_actions_mobile.html | ||
report_post_modal.html | ||
reset_password.html | ||
search.html | ||
search_comments.html | ||
search_users.html | ||
settings.html | ||
settings2.html | ||
settings_apps.html | ||
settings_blocks.html | ||
settings_css.html | ||
settings_filters.html | ||
settings_profile.html | ||
settings_profilecss.html | ||
settings_security.html | ||
shadowbanned.html | ||
shop.html | ||
sidebar.html | ||
sidebar_Cringetopia.html | ||
sidebar_PCM.html | ||
sidebar_WPD.html | ||
sidebar_rDrama.html | ||
sign_up.html | ||
sign_up_failed_ref.html | ||
submission.html | ||
submission_banned.html | ||
submission_listing.html | ||
submit.html | ||
transfers.html | ||
user_listing.html | ||
userpage.html | ||
userpage_blocked.html | ||
userpage_blocking.html | ||
userpage_comments.html | ||
userpage_private.html | ||
userpage_reserved.html | ||
viewers.html | ||
voted_comments.html | ||
voted_posts.html | ||
voters.html | ||
votes.html |