Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kalebmckale
Copy link

@kalebmckale kalebmckale commented Jul 5, 2023

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: ❌

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.
@kalebmckale
Copy link
Author

kalebmckale commented Jul 5, 2023

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: ✅

Instead of implementing matching text by updating `isEdited`, add
condition to have it fall through to either deleted or ignored. Also,
implemented a `match` ignoreReason counter for `match`.
@kalebmckale
Copy link
Author

kalebmckale commented Jul 5, 2023

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: ✅

Updated `match` conditional to also tick the `ignore` counter. Thought
this was part of the fall-through, but it appears not to be after all.
@kalebmckale
Copy link
Author

kalebmckale commented Jul 5, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant