use different labels for `porn` and `sexual` (#3282)

* use different labels for `porn` and `sexual`

* newline
zio/stable
Hailey 2024-03-19 17:47:10 -07:00 committed by GitHub
parent bdf77f8548
commit a90566d864
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -118,11 +118,15 @@ export function useModerationCauseDescription(
(labeler?.creator.handle ? '@' + labeler?.creator.handle : undefined) (labeler?.creator.handle ? '@' + labeler?.creator.handle : undefined)
if (!source) { if (!source) {
if (cause.label.src === BSKY_LABELER_DID) { if (cause.label.src === BSKY_LABELER_DID) {
source = 'Bluesky Moderation' source = 'Bluesky Moderation Service'
} else { } else {
source = cause.label.src source = cause.label.src
} }
} }
if (def.identifier === 'porn' || def.identifier === 'sexual') {
strings.name = 'Adult Content'
}
return { return {
icon: icon:
def.identifier === '!no-unauthenticated' def.identifier === '!no-unauthenticated'

View File

@ -46,7 +46,7 @@ export function FeedErrorMessage({
if ( if (
typeof knownError !== 'undefined' && typeof knownError !== 'undefined' &&
knownError !== KnownError.Unknown && knownError !== KnownError.Unknown &&
feedDesc.startsWith('feedgen') (feedDesc.startsWith('feedgen') || knownError === KnownError.FeedNSFPublic)
) { ) {
return ( return (
<FeedgenErrorMessage <FeedgenErrorMessage
@ -240,6 +240,9 @@ function detectKnownError(
if (typeof error !== 'string') { if (typeof error !== 'string') {
error = error.toString() error = error.toString()
} }
if (error.includes(KnownError.FeedNSFPublic)) {
return KnownError.FeedNSFPublic
}
if (!feedDesc.startsWith('feedgen')) { if (!feedDesc.startsWith('feedgen')) {
return KnownError.Unknown return KnownError.Unknown
} }
@ -263,8 +266,5 @@ function detectKnownError(
if (error.includes('feed provided an invalid response')) { if (error.includes('feed provided an invalid response')) {
return KnownError.FeedgenBadResponse return KnownError.FeedgenBadResponse
} }
if (error.includes(KnownError.FeedNSFPublic)) {
return KnownError.FeedNSFPublic
}
return KnownError.FeedgenUnknown return KnownError.FeedgenUnknown
} }