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