themotte / rDrama

This code runs https://www.themotte.org. Forked from https://github.com/Aevann1/rDrama
GNU Affero General Public License v3.0
25 stars 31 forks source link

~new~ tag gets duplicated somehow #608

Closed zorbathut closed 1 year ago

zorbathut commented 1 year ago

image

oh I know a reproduction for #608. aqouta mentioned it elsewhere. it's when you load another page of comments ("view more comments" button at bottom of page), the JS to add ~new~ gets run on all comments, not just the ones loaded. and it's not idempotent: it appends

solutions would be either restrict range of execution to the newly loaded comments (probably more difficult, given our markup) or make it so you can run it twice on the same comment and only wind up with one ~new~

Probably "run it twice on the same comment and only append if it's already there" is the right fix.