From e20cd9c1cf53e788df3d847797a0ee80d98843fa Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 14 Jun 2024 16:26:54 -0700 Subject: [PATCH] more validation --- src/screens/StarterPack/StarterPackScreen.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/screens/StarterPack/StarterPackScreen.tsx b/src/screens/StarterPack/StarterPackScreen.tsx index 13e90ad0a8..ff32140fa2 100644 --- a/src/screens/StarterPack/StarterPackScreen.tsx +++ b/src/screens/StarterPack/StarterPackScreen.tsx @@ -38,6 +38,8 @@ import {Text} from '#/components/Typography' export function StarterPackScreen({ route, }: NativeStackScreenProps) { + const {_} = useLingui() + const {name, rkey} = route.params const { data: did, @@ -50,11 +52,17 @@ export function StarterPackScreen({ isError: isErrorStarterPack, } = useStarterPackQuery({did, rkey}) - if (!did || !starterPack) { + const isValid = + starterPack && + AppBskyGraphDefs.validateStarterPackView(starterPack) && + AppBskyGraphStarterpack.validateRecord(starterPack.record) + + if (!did || !starterPack || !isValid) { return ( ) }