[SDK] Validate and brand the persisted account did (#11387)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {useMemo} from 'react'
|
||||
import {retry} from '@atproto/common-web'
|
||||
import {type $Typed, type l, type UriString} from '@atproto/lex'
|
||||
import {type AtIdentifierString, AtUri, toDatetimeString} from '@atproto/syntax'
|
||||
import {AtUri, toDatetimeString} from '@atproto/syntax'
|
||||
import {moderateStatus} from '@bsky.app/sdk/moderation'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
@@ -276,8 +276,7 @@ export function useUpsertLiveStatusMutation(
|
||||
} satisfies app.bsky.actor.status.Main
|
||||
|
||||
const upsert = async () => {
|
||||
// the session account is still legacy-typed, so its did is unbranded
|
||||
const repo = currentAccount.did as AtIdentifierString
|
||||
const repo = currentAccount.did
|
||||
const collection = 'app.bsky.actor.status'
|
||||
|
||||
const existing = await pdsClient
|
||||
@@ -369,7 +368,7 @@ export function useRemoveLiveStatusMutation() {
|
||||
if (!currentAccount) throw new Error('Not logged in')
|
||||
|
||||
await pdsClient.delete(app.bsky.actor.status, {
|
||||
repo: currentAccount.did as AtIdentifierString,
|
||||
repo: currentAccount.did,
|
||||
rkey: 'self',
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user