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

🐛 Show all labels in selector that can be edited by labeler #192

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

foysalit
Copy link
Contributor

Currently, if a user applies a self label porn and automod also labels the post with porn, the label selector won't show porn as already selected because it thinks porn is a self label, hence, not removable. This PR fixes it.

@arcalinea arcalinea temporarily deployed to fix-self-and-label-conflict - ozone-staging PR #192 September 16, 2024 22:27 — with Render Destroyed
Comment on lines -662 to +665
const isExternalLabel = allLabels.some((l) => {
return l.val === label && l.src !== config.did
// If there's a label where the source is the current labeler, it's editable
const isEditableLabel = allLabels.some((l) => {
return l.val === label && l.src === config.did
})
return !isSelfLabel(label) && !isExternalLabel
return !isSelfLabel(label) && isEditableLabel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance of isEditableLabel being true for a self-label? Perhaps this could be simplified down to just isEditableLabel.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc, the selfLabel check prevents labels that look like porn(self) to show up in the selector so we would still want to filter those out.

@foysalit foysalit merged commit 0fd04c1 into main Sep 19, 2024
3 checks passed
@matthieusieben matthieusieben deleted the fix-self-and-label-conflict branch November 15, 2024 14:54
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.

3 participants