drop the did assertions the brand makes redundant
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -63,7 +62,7 @@ function Inner({control}: {control: Dialog.DialogControlProps}) {
|
|||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
// the persisted account did is already resolved
|
// the persisted account did is already resolved
|
||||||
did: currentAccount.did as DidString,
|
did: currentAccount.did,
|
||||||
},
|
},
|
||||||
reason: `AGE_ASSURANCE_INQUIRY: ` + details,
|
reason: `AGE_ASSURANCE_INQUIRY: ` + details,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {TID} from '@atproto/common-web'
|
import {TID} from '@atproto/common-web'
|
||||||
import {type $Typed} from '@atproto/lex'
|
import {type $Typed} from '@atproto/lex'
|
||||||
import {
|
import {AtUri, type AtUriString, toDatetimeString} from '@atproto/syntax'
|
||||||
type AtIdentifierString,
|
|
||||||
AtUri,
|
|
||||||
type AtUriString,
|
|
||||||
toDatetimeString,
|
|
||||||
} from '@atproto/syntax'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -99,7 +94,7 @@ export function CreateListFromStarterPackDialog({
|
|||||||
const chunks = chunk(listitemWrites, 50)
|
const chunks = chunk(listitemWrites, 50)
|
||||||
for (const c of chunks) {
|
for (const c of chunks) {
|
||||||
await pdsClient.call(com.atproto.repo.applyWrites, {
|
await pdsClient.call(com.atproto.repo.applyWrites, {
|
||||||
repo: currentAccount.did as AtIdentifierString,
|
repo: currentAccount.did,
|
||||||
writes: c,
|
writes: c,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-4
@@ -76,15 +76,13 @@ export const LOG_DEBUG: string = process.env.EXPO_PUBLIC_LOG_DEBUG || ''
|
|||||||
* The DID of the Bluesky appview to proxy to
|
* The DID of the Bluesky appview to proxy to
|
||||||
*/
|
*/
|
||||||
export const BLUESKY_PROXY_DID: DidString =
|
export const BLUESKY_PROXY_DID: DidString =
|
||||||
(process.env.EXPO_PUBLIC_BLUESKY_PROXY_DID as DidString) ||
|
process.env.EXPO_PUBLIC_BLUESKY_PROXY_DID || 'did:web:api.bsky.app'
|
||||||
'did:web:api.bsky.app'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DID of the chat service to proxy to
|
* The DID of the chat service to proxy to
|
||||||
*/
|
*/
|
||||||
export const CHAT_PROXY_DID: DidString =
|
export const CHAT_PROXY_DID: DidString =
|
||||||
(process.env.EXPO_PUBLIC_CHAT_PROXY_DID as DidString) ||
|
process.env.EXPO_PUBLIC_CHAT_PROXY_DID || 'did:web:api.bsky.chat'
|
||||||
'did:web:api.bsky.chat'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metrics API host
|
* Metrics API host
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {retry} from '@atproto/common-web'
|
import {retry} from '@atproto/common-web'
|
||||||
import {type $Typed, type l, type UriString} from '@atproto/lex'
|
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 {moderateStatus} from '@bsky.app/sdk/moderation'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -277,7 +277,7 @@ export function useUpsertLiveStatusMutation(
|
|||||||
|
|
||||||
const upsert = async () => {
|
const upsert = async () => {
|
||||||
// the session account is still legacy-typed, so its did is unbranded
|
// 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 collection = 'app.bsky.actor.status'
|
||||||
|
|
||||||
const existing = await pdsClient
|
const existing = await pdsClient
|
||||||
@@ -369,7 +369,7 @@ export function useRemoveLiveStatusMutation() {
|
|||||||
if (!currentAccount) throw new Error('Not logged in')
|
if (!currentAccount) throw new Error('Not logged in')
|
||||||
|
|
||||||
await pdsClient.delete(app.bsky.actor.status, {
|
await pdsClient.delete(app.bsky.actor.status, {
|
||||||
repo: currentAccount.did as AtIdentifierString,
|
repo: currentAccount.did,
|
||||||
rkey: 'self',
|
rkey: 'self',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback, useState} from 'react'
|
import {useCallback, useState} from 'react'
|
||||||
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useMutation} from '@tanstack/react-query'
|
import {useMutation} from '@tanstack/react-query'
|
||||||
|
|
||||||
@@ -107,7 +106,7 @@ function DialogInner() {
|
|||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
// the persisted account did is already resolved
|
// the persisted account did is already resolved
|
||||||
did: currentAccount.did as DidString,
|
did: currentAccount.did,
|
||||||
},
|
},
|
||||||
reason: details,
|
reason: details,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback, useRef, useState} from 'react'
|
import {useCallback, useRef, useState} from 'react'
|
||||||
import {type TextInput, View} from 'react-native'
|
import {type TextInput, View} from 'react-native'
|
||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -127,7 +126,7 @@ function DeleteAccountDialogInner({
|
|||||||
await chatClient.call(chat.bsky.actor.deleteAccount)
|
await chatClient.call(chat.bsky.actor.deleteAccount)
|
||||||
await client.call(com.atproto.server.deleteAccount, {
|
await client.call(com.atproto.server.deleteAccount, {
|
||||||
// the persisted account did is already resolved
|
// the persisted account did is already resolved
|
||||||
did: currentAccount.did as DidString,
|
did: currentAccount.did,
|
||||||
password,
|
password,
|
||||||
token,
|
token,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback, useState} from 'react'
|
import {useCallback, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
import {saveBytesToDisk} from '#/lib/media/manip'
|
import {saveBytesToDisk} from '#/lib/media/manip'
|
||||||
@@ -34,7 +33,7 @@ export function ExportCarDialog({
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
setLoading('repo')
|
setLoading('repo')
|
||||||
const did = currentAccount.did as DidString
|
const did = currentAccount.did
|
||||||
const data = await pdsClient.call(com.atproto.sync.getRepo, {did})
|
const data = await pdsClient.call(com.atproto.sync.getRepo, {did})
|
||||||
/*
|
/*
|
||||||
* getRepo declares `application/vnd.ipld.car`, so lex-client hands back
|
* getRepo declares `application/vnd.ipld.car`, so lex-client hands back
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import {useState} from 'react'
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -58,7 +57,7 @@ export function Takendown() {
|
|||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
// the persisted account did is already resolved
|
// the persisted account did is already resolved
|
||||||
did: currentAccount.did as DidString,
|
did: currentAccount.did,
|
||||||
},
|
},
|
||||||
reason: appealText,
|
reason: appealText,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,11 +39,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
/*
|
userDid,
|
||||||
* `did`/`hiddenPosts` come from persisted storage typed as plain
|
|
||||||
* `string`, so brand them to the SDK's `DidString`/`AtUriString` slots.
|
|
||||||
*/
|
|
||||||
userDid: userDid as ModerationOpts['userDid'],
|
|
||||||
prefs: {
|
prefs: {
|
||||||
...moderationPrefs,
|
...moderationPrefs,
|
||||||
labelers: moderationPrefs.labelers.length
|
labelers: moderationPrefs.labelers.length
|
||||||
@@ -52,6 +48,10 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
did,
|
did,
|
||||||
labels: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES,
|
labels: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES,
|
||||||
})),
|
})),
|
||||||
|
/*
|
||||||
|
* `hiddenPosts` comes from persisted storage typed as plain `string`,
|
||||||
|
* so brand it to the SDK's `AtUriString` slot.
|
||||||
|
*/
|
||||||
hiddenPosts: (hiddenPosts ||
|
hiddenPosts: (hiddenPosts ||
|
||||||
[]) as ModerationOpts['prefs']['hiddenPosts'],
|
[]) as ModerationOpts['prefs']['hiddenPosts'],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import {type AtIdentifierString} from '@atproto/syntax'
|
|
||||||
import {t} from '@lingui/core/macro'
|
import {t} from '@lingui/core/macro'
|
||||||
import {
|
import {
|
||||||
type InfiniteData,
|
type InfiniteData,
|
||||||
@@ -42,7 +41,7 @@ export function useNotificationDeclarationQuery() {
|
|||||||
try {
|
try {
|
||||||
const response = await client.get(app.bsky.notification.declaration, {
|
const response = await client.get(app.bsky.notification.declaration, {
|
||||||
// the session account is still legacy-typed, so its did is unbranded
|
// the session account is still legacy-typed, so its did is unbranded
|
||||||
repo: currentAccount!.did as AtIdentifierString,
|
repo: currentAccount!.did,
|
||||||
rkey: 'self',
|
rkey: 'self',
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
@@ -72,7 +71,7 @@ export function useNotificationDeclarationMutation() {
|
|||||||
app.bsky.notification.declaration,
|
app.bsky.notification.declaration,
|
||||||
record,
|
record,
|
||||||
{
|
{
|
||||||
repo: currentAccount!.did as AtIdentifierString,
|
repo: currentAccount!.did,
|
||||||
rkey: 'self',
|
rkey: 'self',
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export function useListMembershipRemoveMutation({
|
|||||||
}
|
}
|
||||||
const membershipUrip = new AtUri(membershipUri)
|
const membershipUrip = new AtUri(membershipUri)
|
||||||
await pdsClient.delete(app.bsky.graph.listitem, {
|
await pdsClient.delete(app.bsky.graph.listitem, {
|
||||||
repo: currentAccount.did as DidString,
|
repo: currentAccount.did,
|
||||||
rkey: membershipUrip.rkeySafe,
|
rkey: membershipUrip.rkeySafe,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import {type $Typed, type Client} from '@atproto/lex'
|
import {type $Typed, type Client} from '@atproto/lex'
|
||||||
import {
|
import {AtUri, type AtUriString, toDatetimeString} from '@atproto/syntax'
|
||||||
type AtIdentifierString,
|
|
||||||
AtUri,
|
|
||||||
type AtUriString,
|
|
||||||
toDatetimeString,
|
|
||||||
} from '@atproto/syntax'
|
|
||||||
import {
|
import {
|
||||||
blockActorList,
|
blockActorList,
|
||||||
muteActorList,
|
muteActorList,
|
||||||
@@ -195,7 +190,7 @@ export function useListDeleteMutation() {
|
|||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
const res = await pdsClient.list(app.bsky.graph.listitem, {
|
const res = await pdsClient.list(app.bsky.graph.listitem, {
|
||||||
// the session account is still legacy-typed, so its did is unbranded
|
// the session account is still legacy-typed, so its did is unbranded
|
||||||
repo: currentAccount.did as AtIdentifierString,
|
repo: currentAccount.did,
|
||||||
cursor,
|
cursor,
|
||||||
limit: 100,
|
limit: 100,
|
||||||
})
|
})
|
||||||
@@ -228,7 +223,7 @@ export function useListDeleteMutation() {
|
|||||||
// apply in chunks
|
// apply in chunks
|
||||||
for (const writesChunk of chunk(writes, 10)) {
|
for (const writesChunk of chunk(writes, 10)) {
|
||||||
await pdsClient.call(com.atproto.repo.applyWrites, {
|
await pdsClient.call(com.atproto.repo.applyWrites, {
|
||||||
repo: currentAccount.did as AtIdentifierString,
|
repo: currentAccount.did,
|
||||||
writes: writesChunk,
|
writes: writesChunk,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function useUpdateActorDeclaration({
|
|||||||
})
|
})
|
||||||
const result = await pdsClient.call(com.atproto.repo.putRecord, {
|
const result = await pdsClient.call(com.atproto.repo.putRecord, {
|
||||||
// the session account is still legacy-typed, so its did is unbranded
|
// the session account is still legacy-typed, so its did is unbranded
|
||||||
repo: currentAccount.did as DidString,
|
repo: currentAccount.did,
|
||||||
collection: 'chat.bsky.actor.declaration',
|
collection: 'chat.bsky.actor.declaration',
|
||||||
rkey: 'self',
|
rkey: 'self',
|
||||||
record: {
|
record: {
|
||||||
@@ -106,7 +106,7 @@ export function useDeleteActorDeclaration() {
|
|||||||
mutationFn: async () => {
|
mutationFn: async () => {
|
||||||
if (!currentAccount) throw new Error('Not signed in')
|
if (!currentAccount) throw new Error('Not signed in')
|
||||||
const result = await pdsClient.call(com.atproto.repo.deleteRecord, {
|
const result = await pdsClient.call(com.atproto.repo.deleteRecord, {
|
||||||
repo: currentAccount.did as DidString,
|
repo: currentAccount.did,
|
||||||
collection: 'chat.bsky.actor.declaration',
|
collection: 'chat.bsky.actor.declaration',
|
||||||
rkey: 'self',
|
rkey: 'self',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {type QueryClient, useQuery} from '@tanstack/react-query'
|
import {type QueryClient, useQuery} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {accumulate} from '#/lib/async/accumulate'
|
import {accumulate} from '#/lib/async/accumulate'
|
||||||
@@ -27,7 +26,7 @@ export function useMyListsQuery(filter: MyListsFilter) {
|
|||||||
accumulate(cursor =>
|
accumulate(cursor =>
|
||||||
client
|
client
|
||||||
.call(app.bsky.graph.getLists, {
|
.call(app.bsky.graph.getLists, {
|
||||||
actor: currentAccount!.did as DidString,
|
actor: currentAccount!.did,
|
||||||
cursor,
|
cursor,
|
||||||
limit: 50,
|
limit: 50,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||||
@@ -36,7 +35,7 @@ export function usePinnedPostMutation() {
|
|||||||
// get the currently pinned post so we can optimistically remove the pin from it
|
// get the currently pinned post so we can optimistically remove the pin from it
|
||||||
if (!currentAccount) throw new Error('Not signed in')
|
if (!currentAccount) throw new Error('Not signed in')
|
||||||
const profile = await client.call(app.bsky.actor.getProfile, {
|
const profile = await client.call(app.bsky.actor.getProfile, {
|
||||||
actor: currentAccount.did as DidString,
|
actor: currentAccount.did,
|
||||||
})
|
})
|
||||||
prevPinnedPost = profile.pinnedPost?.uri
|
prevPinnedPost = profile.pinnedPost?.uri
|
||||||
if (prevPinnedPost && prevPinnedPost !== postUri) {
|
if (prevPinnedPost && prevPinnedPost !== postUri) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {
|
import {
|
||||||
type InfiniteData,
|
type InfiniteData,
|
||||||
type QueryClient,
|
type QueryClient,
|
||||||
@@ -51,7 +50,7 @@ export function useProfileFollowersQuery(
|
|||||||
* is `undefined`, hence the conditional spread.
|
* is `undefined`, hence the conditional spread.
|
||||||
*/
|
*/
|
||||||
return await client.call(app.bsky.graph.getFollowers, {
|
return await client.call(app.bsky.graph.getFollowers, {
|
||||||
actor: (did || '') as DidString,
|
actor: did || '',
|
||||||
limit: PAGE_SIZE,
|
limit: PAGE_SIZE,
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
...(sortParam ? {sort: sortParam} : {}),
|
...(sortParam ? {sort: sortParam} : {}),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {
|
import {
|
||||||
type InfiniteData,
|
type InfiniteData,
|
||||||
type QueryClient,
|
type QueryClient,
|
||||||
@@ -56,7 +55,7 @@ export function useProfileFollowsQuery(
|
|||||||
* is `undefined`, hence the conditional spread.
|
* is `undefined`, hence the conditional spread.
|
||||||
*/
|
*/
|
||||||
return await client.call(app.bsky.graph.getFollows, {
|
return await client.call(app.bsky.graph.getFollows, {
|
||||||
actor: (did || '') as DidString,
|
actor: did || '',
|
||||||
limit: limit || PAGE_SIZE,
|
limit: limit || PAGE_SIZE,
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
...(sortParam ? {sort: sortParam} : {}),
|
...(sortParam ? {sort: sortParam} : {}),
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ function useProfileUnblockMutation() {
|
|||||||
}
|
}
|
||||||
const {rkeySafe: rkey} = new AtUri(blockUri)
|
const {rkeySafe: rkey} = new AtUri(blockUri)
|
||||||
await pdsClient.delete(app.bsky.graph.block, {
|
await pdsClient.delete(app.bsky.graph.block, {
|
||||||
repo: currentAccount.did as AtIdentifierString,
|
repo: currentAccount.did,
|
||||||
rkey,
|
rkey,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ function makeBundle(account: SessionAccount): FakeBundle {
|
|||||||
refreshJwt: account.refreshJwt ?? '',
|
refreshJwt: account.refreshJwt ?? '',
|
||||||
/* SessionData types these as branded strings; the values are fixtures */
|
/* SessionData types these as branded strings; the values are fixtures */
|
||||||
handle: account.handle as `${string}.${string}`,
|
handle: account.handle as `${string}.${string}`,
|
||||||
did: account.did as `did:${string}:${string}`,
|
did: account.did,
|
||||||
active: true,
|
active: true,
|
||||||
service: account.service,
|
service: account.service,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export function sessionAccountToSessionData(
|
|||||||
return {
|
return {
|
||||||
accessJwt: account.accessJwt ?? '',
|
accessJwt: account.accessJwt ?? '',
|
||||||
active: account.active ?? true,
|
active: account.active ?? true,
|
||||||
did: account.did as SessionData['did'],
|
did: account.did,
|
||||||
email: account.email,
|
email: account.email,
|
||||||
emailAuthFactor: account.emailAuthFactor,
|
emailAuthFactor: account.emailAuthFactor,
|
||||||
emailConfirmed: account.emailConfirmed,
|
emailConfirmed: account.emailConfirmed,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {useCallback, useEffect, useState} from 'react'
|
import {useCallback, useEffect, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {type DidString} from '@atproto/syntax'
|
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ export function LoggedOut({onDismiss}: {onDismiss?: () => void}) {
|
|||||||
const {accounts} = useSession()
|
const {accounts} = useSession()
|
||||||
const client = useAppviewClient()
|
const client = useAppviewClient()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const actors = accounts.map(acc => acc.did as DidString)
|
const actors = accounts.map(acc => acc.did)
|
||||||
if (actors.length === 0) return
|
if (actors.length === 0) return
|
||||||
void queryClient.prefetchQuery({
|
void queryClient.prefetchQuery({
|
||||||
queryKey: profilesQueryKey(actors),
|
queryKey: profilesQueryKey(actors),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
View,
|
View,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {TID} from '@atproto/common-web'
|
import {TID} from '@atproto/common-web'
|
||||||
import {AtUri, type DidString} from '@atproto/syntax'
|
import {AtUri} from '@atproto/syntax'
|
||||||
import {
|
import {
|
||||||
moderateProfile,
|
moderateProfile,
|
||||||
type ModerationDecision,
|
type ModerationDecision,
|
||||||
@@ -915,7 +915,7 @@ function SayHelloBtn({profile}: {profile: app.bsky.actor.defs.ProfileView}) {
|
|||||||
const data = await client.call(chat.bsky.convo.getConvoForMembers, {
|
const data = await client.call(chat.bsky.convo.getConvoForMembers, {
|
||||||
// both dids are already resolved - one from the profile view, one from
|
// both dids are already resolved - one from the profile view, one from
|
||||||
// the active session
|
// the active session
|
||||||
members: [profile.did, currentAccount!.did] as DidString[],
|
members: [profile.did, currentAccount!.did],
|
||||||
})
|
})
|
||||||
navigation.navigate('MessagesConversation', {
|
navigation.navigate('MessagesConversation', {
|
||||||
conversation: data.convo.id,
|
conversation: data.convo.id,
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
|
|||||||
blockingByList: undefined,
|
blockingByList: undefined,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
mockedProfile.did = did as app.bsky.actor.defs.ProfileViewBasic['did']
|
mockedProfile.did = did
|
||||||
mockedProfile.avatar = 'https://bsky.social/about/images/favicon-32x32.png'
|
mockedProfile.avatar = 'https://bsky.social/about/images/favicon-32x32.png'
|
||||||
// @ts-expect-error ProfileViewBasic is close enough -esb
|
// @ts-expect-error ProfileViewBasic is close enough -esb
|
||||||
mockedProfile.banner =
|
mockedProfile.banner =
|
||||||
|
|||||||
Reference in New Issue
Block a user