Fix type errors
This commit is contained in:
@@ -127,7 +127,10 @@ export function useStarterPackLink({
|
||||
|
||||
return {
|
||||
to: `/starter-pack/${handleOrDid}/${rkey}`,
|
||||
label: AppBskyGraphStarterpack.isRecord(view.record)
|
||||
label: bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||
view.record,
|
||||
AppBskyGraphStarterpack.isRecord,
|
||||
)
|
||||
? _(msg`Navigate to ${view.record.name}`)
|
||||
: _(msg`Navigate to starter pack`),
|
||||
precache,
|
||||
@@ -151,7 +154,12 @@ export function Link({
|
||||
return {rkey, handleOrDid: creator.handle || creator.did}
|
||||
}, [starterPack])
|
||||
|
||||
if (!AppBskyGraphStarterpack.isRecord(record)) {
|
||||
if (
|
||||
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||
record,
|
||||
AppBskyGraphStarterpack.isRecord,
|
||||
)
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function HashtagScreen({
|
||||
}, [fullTag, isCashtag])
|
||||
|
||||
const sanitizedAuthor = React.useMemo(() => {
|
||||
if (!author) return
|
||||
if (!author) return ''
|
||||
return sanitizeHandle(author)
|
||||
}, [author])
|
||||
|
||||
|
||||
@@ -20,9 +20,11 @@ export function StepDetails() {
|
||||
const {currentAccount} = useSession()
|
||||
const {data: currentProfile} = useProfileQuery({
|
||||
did: currentAccount?.did,
|
||||
staleTime: 300,
|
||||
staleTime: Infinity,
|
||||
})
|
||||
|
||||
const name = currentProfile?.displayName || currentProfile?.handle
|
||||
|
||||
return (
|
||||
<ScreenTransition direction={state.transitionDirection} enabledWeb>
|
||||
<View style={[a.px_xl, a.gap_xl, a.mt_4xl]}>
|
||||
@@ -43,11 +45,9 @@ export function StepDetails() {
|
||||
</TextField.LabelText>
|
||||
<TextField.Root>
|
||||
<TextField.Input
|
||||
label={_(
|
||||
msg`${
|
||||
currentProfile?.displayName || currentProfile?.handle
|
||||
}'s starter pack`,
|
||||
)}
|
||||
label={
|
||||
name ? _(msg`${name}'s starter pack`) : _(msg`My starter pack`)
|
||||
}
|
||||
value={state.name}
|
||||
onChangeText={text => dispatch({type: 'SetName', name: text})}
|
||||
/>
|
||||
@@ -71,11 +71,11 @@ export function StepDetails() {
|
||||
</TextField.LabelText>
|
||||
<TextField.Root>
|
||||
<TextField.Input
|
||||
label={_(
|
||||
msg`${
|
||||
currentProfile?.displayName || currentProfile?.handle
|
||||
}'s favorite feeds and people - join me!`,
|
||||
)}
|
||||
label={
|
||||
name
|
||||
? _(msg`${name}'s favorite feeds and people - join me!`)
|
||||
: _(msg`My favorite feeds and people - join me!`)
|
||||
}
|
||||
value={state.description}
|
||||
onChangeText={text =>
|
||||
dispatch({type: 'SetDescription', description: text})
|
||||
|
||||
@@ -352,7 +352,7 @@ async function whenAppViewReady(
|
||||
)
|
||||
}
|
||||
|
||||
export async function precacheStarterPack(
|
||||
export function precacheStarterPack(
|
||||
queryClient: QueryClient,
|
||||
starterPack:
|
||||
| AppBskyGraphDefs.StarterPackViewBasic
|
||||
|
||||
Reference in New Issue
Block a user