pkolyvas / PowerDeleteSuite

Power Delete Suite for Reddit
89 stars 6 forks source link

Don't edit if existing text matches replacement text. #4

Open kalebmckale opened 12 months ago

kalebmckale commented 12 months ago

Update Boolean value of pdEdited (if false) based on whether or not the existing text matches the replacement text. If pdEdited is already true, this update will not change that value. This will prevent updating entries that already match the replacement text.

UPDATE: ❌

kalebmckale commented 12 months ago

Addresses Issue #3

Needs testing. I’m experienced in programming other languages but not JavaScript. I think this is correct, but it would be best for someone to review for syntax and make sure it works.

UPDATE: ✅

kalebmckale commented 12 months ago

I went back and took a different approach. Instead of treating the matches as edited, which works but throws off the counts, I created a new counter match and added a condition instead to let the matches fall through to ignore condition. It does work (I figured out how to test it), but it doesn’t show ignore counters unless another filter option is selected. So, that’s a fix I need to look into.

UPDATE: ✅

kalebmckale commented 12 months ago

IMG_1072 @pkolyvas So, I “fixed” the display and counter for ignored, but it appears it’s not part of the fall-through as I previously thought. Makes me wonder if my initial approach to put logic in shouldBeActedOn would have been better approach to avoid all the special logic I’ve added. However, my knowledge of JavaScript is such that I don’t know if this would cause comments and posts to miss the delete logic if both edit and delete are checked. It looked like it would, but somehow the code still does both branches normally. Perhaps there is a way to get shouldBeActedOn to be false when applying edit but true when applying delete.

Any ideas?