Implement validation and proper type detection

This commit is contained in:
Paul Frazee 2023-01-03 13:08:56 -06:00
parent 1acef14a1c
commit b9b0965000
7 changed files with 114 additions and 30 deletions

View file

@ -221,14 +221,14 @@ function AdditionalPostText({
additionalPost?: PostThreadViewModel
}) {
const pal = usePalette('default')
if (!additionalPost) {
if (!additionalPost || !additionalPost.thread?.postRecord) {
return <View />
}
if (additionalPost.error) {
return <ErrorMessage message={additionalPost.error} />
}
return (
<Text style={pal.textLight}>{additionalPost.thread?.post.record.text}</Text>
<Text style={pal.textLight}>{additionalPost.thread?.postRecord.text}</Text>
)
}