tidy up post reasons (#9194)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import {type ModerationUI} from '@atproto/api'
|
||||
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
@@ -5,9 +7,10 @@ import type * as bsky from '#/types/bsky'
|
||||
export function createSanitizedDisplayName(
|
||||
profile: bsky.profile.AnyProfileView,
|
||||
noAt = false,
|
||||
moderation?: ModerationUI,
|
||||
) {
|
||||
if (profile.displayName != null && profile.displayName !== '') {
|
||||
return sanitizeDisplayName(profile.displayName)
|
||||
return sanitizeDisplayName(profile.displayName, moderation)
|
||||
} else {
|
||||
return sanitizeHandle(profile.handle, noAt ? '' : '@')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user