Implement validation and proper type detection

This commit is contained in:
Paul Frazee
2023-01-03 13:08:56 -06:00
parent c68f291128
commit bbee08eb22
7 changed files with 114 additions and 30 deletions
+2 -2
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>
)
}