From d218ee887fdc5d7c42c5f81440d7a1c6716a1016 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 22 Aug 2024 15:25:12 -0700 Subject: [PATCH] `isRecord` above --- .../StarterPack/StarterPackLandingScreen.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/screens/StarterPack/StarterPackLandingScreen.tsx b/src/screens/StarterPack/StarterPackLandingScreen.tsx index 76b767885a..7dda45f968 100644 --- a/src/screens/StarterPack/StarterPackLandingScreen.tsx +++ b/src/screens/StarterPack/StarterPackLandingScreen.tsx @@ -84,9 +84,15 @@ export function LandingScreen({ return } + // Just for types, this cannot be hit + if (!AppBskyGraphStarterpack.isRecord(starterPack.record)) { + return null + } + return ( @@ -95,25 +101,25 @@ export function LandingScreen({ function LandingScreenLoaded({ starterPack, + starterPackRecord: record, setScreenState, // TODO apply this to profile card moderationOpts, }: { starterPack: AppBskyGraphDefs.StarterPackView + starterPackRecord: AppBskyGraphStarterpack.Record setScreenState: (state: LoggedOutScreenState) => void moderationOpts: ModerationOpts }) { - const {record, creator, listItemsSample, feeds} = starterPack + const {creator, listItemsSample, feeds} = starterPack const {_} = useLingui() const t = useTheme() const activeStarterPack = useActiveStarterPack() const setActiveStarterPack = useSetActiveStarterPack() const {isTabletOrDesktop} = useWebMediaQueries() const androidDialogControl = useDialogControl() - const [descriptionRt] = useRichText( - AppBskyGraphStarterpack.isRecord(record) ? record?.description || '' : '', - ) + const [descriptionRt] = useRichText(record.description || '') const [appClipOverlayVisible, setAppClipOverlayVisible] = React.useState(false) @@ -152,10 +158,6 @@ function LandingScreenLoaded({ } } - if (!AppBskyGraphStarterpack.isRecord(record)) { - return null - } - return (