Fix type errors

This commit is contained in:
Samuel Newman
2026-02-19 11:14:10 +02:00
parent 07dcd61160
commit 3f3afa1250
4 changed files with 23 additions and 15 deletions
+10 -2
View File
@@ -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
}
+1 -1
View File
@@ -65,7 +65,7 @@ export default function HashtagScreen({
}, [fullTag, isCashtag])
const sanitizedAuthor = React.useMemo(() => {
if (!author) return
if (!author) return ''
return sanitizeHandle(author)
}, [author])
+11 -11
View File
@@ -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})
+1 -1
View File
@@ -352,7 +352,7 @@ async function whenAppViewReady(
)
}
export async function precacheStarterPack(
export function precacheStarterPack(
queryClient: QueryClient,
starterPack:
| AppBskyGraphDefs.StarterPackViewBasic