move the bluesky labeler did to the sdk api constant

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-04 03:57:18 +03:00
parent 2f482f2c0b
commit 541a82c2dd
6 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import {useMemo} from 'react'
import {View} from 'react-native'
import {BSKY_LABELER_DID} from '@atproto/api'
import {api} from '@bsky.app/sdk'
import {type ModerationCause} from '@bsky.app/sdk/moderation'
import {Trans, useLingui} from '@lingui/react/macro'
@@ -67,7 +67,7 @@ export function Label({
const desc = useModerationCauseDescription(cause)
const isLabeler = Boolean(desc.sourceType && desc.sourceDid)
const isBlueskyLabel =
desc.sourceType === 'labeler' && desc.sourceDid === BSKY_LABELER_DID
desc.sourceType === 'labeler' && desc.sourceDid === api.moderation.did
const avi = size === 'lg' ? 16 : 12
return (
@@ -1,5 +1,6 @@
import {BSKY_LABELER_DID} from '@atproto/api'
import {type AtUriString, type DidString} from '@atproto/syntax'
import {api} from '@bsky.app/sdk'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
import {useMutation} from '@tanstack/react-query'
@@ -121,7 +122,7 @@ export function useSubmitReportMutation() {
state.includeVideoTimestamp &&
videoTimestampSeconds != null &&
subject.type === 'post' &&
labeler.creator.did === BSKY_LABELER_DID
labeler.creator.did === api.moderation.did
? {videoTimestampSeconds}
: undefined
@@ -7,7 +7,7 @@ import {
useState,
} from 'react'
import {Pressable, type ScrollView, View} from 'react-native'
import {BSKY_LABELER_DID} from '@atproto/api'
import {api} from '@bsky.app/sdk'
import {Trans, useLingui} from '@lingui/react/macro'
import {wait} from '#/lib/async/wait'
@@ -223,7 +223,7 @@ function Inner(
.filter(l => {
if (!state.selectedOption) return false
if (isBskyOnlyReason || isBskyOnlySubject) {
return l.creator.did === BSKY_LABELER_DID
return l.creator.did === api.moderation.did
}
const supportedReasonTypes: string[] | undefined = l.reasonTypes
if (supportedReasonTypes === undefined) return true
+3 -2
View File
@@ -1,6 +1,7 @@
import {type Insets, Platform} from 'react-native'
import {type AppBskyActorDefs, BSKY_LABELER_DID} from '@atproto/api'
import {type AppBskyActorDefs} from '@atproto/api'
import {type Service} from '@atproto/lex'
import {api} from '@bsky.app/sdk'
import {BLUESKY_PROXY_DID, CHAT_PROXY_DID, IS_DEV} from '#/env'
@@ -269,7 +270,7 @@ export const CHAT_PROXY_SERVICE: Service = `${CHAT_PROXY_DID}#bsky_chat`
* that labeler's creator did instead, so this is a per-call option rather than a
* client-level one like {@link CHAT_PROXY_SERVICE}.
*/
export const MOD_PROXY_SERVICE: Service = `${BSKY_LABELER_DID}#atproto_labeler`
export const MOD_PROXY_SERVICE: Service = `${api.moderation.did}#atproto_labeler`
/**
* The notification service's proxy target, in the `did#service_id` form a lex
@@ -1,5 +1,5 @@
import {useMemo} from 'react'
import {BSKY_LABELER_DID} from '@atproto/api'
import {api} from '@bsky.app/sdk'
import {type ModerationCause} from '@bsky.app/sdk/moderation'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
@@ -135,7 +135,7 @@ export function useModerationCauseDescription(
: undefined
let sourceDisplayName = labeler?.creator.displayName
if (!source) {
if (cause.label.src === BSKY_LABELER_DID) {
if (cause.label.src === api.moderation.did) {
source = 'moderation.bsky.app'
sourceDisplayName = 'Bluesky Moderation Service'
} else {
+3 -3
View File
@@ -1,6 +1,6 @@
import {BSKY_LABELER_DID} from '@atproto/api'
import {type Client} from '@atproto/lex'
import {type DidString} from '@atproto/syntax'
import {api} from '@bsky.app/sdk'
import {IS_TEST_USER} from '#/lib/constants'
import {com} from '#/lexicons'
@@ -53,7 +53,7 @@ export function applyLabelersToClient(
subscribedDids: string[],
) {
client.setLabelers(
subscribedDids.filter(did => did !== BSKY_LABELER_DID) as DidString[],
subscribedDids.filter(did => did !== api.moderation.did) as DidString[],
)
}
@@ -94,7 +94,7 @@ export function configureModerationForAccount(
}
function switchToBskyAppLabeler() {
configureGlobalAppLabelers([BSKY_LABELER_DID])
configureGlobalAppLabelers([api.moderation.did])
}
/** Resolve and install the test environment's moderation authority. */