Fix accidental unwrapped strings (#1826)

zio/stable
dan 2023-11-06 22:42:25 +00:00 committed by GitHub
parent d715246e26
commit a4baf14e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -51,14 +51,14 @@ export const ExternalEmbed = ({
{link.meta.description}
</Text>
)}
{!!link.meta?.error && (
{link.meta?.error ? (
<Text
type="sm"
numberOfLines={2}
style={[{color: palError.colors.background}, styles.description]}>
{link.meta.error}
</Text>
)}
) : null}
</View>
<TouchableOpacity
style={styles.removeBtn}

View File

@ -484,13 +484,13 @@ function CustomHandleForm({
</Text>
</View>
)}
{error && (
{error ? (
<View style={[styles.message, palError.view]}>
<Text type="md-medium" style={palError.text}>
{error}
</Text>
</View>
)}
) : null}
<Button
type="primary"
style={[s.p20, isVerifying && styles.dimmed]}

View File

@ -284,13 +284,13 @@ function SavedFeed({feed}: {feed: FeedSourceModel}) {
<Text type="lg-medium" style={pal.text} numberOfLines={1}>
{feed.displayName}
</Text>
{feed.error && (
{feed.error ? (
<View style={[styles.offlineSlug, pal.borderDark]}>
<Text type="xs" style={pal.textLight}>
Feed offline
</Text>
</View>
)}
) : null}
</View>
{isMobile && (
<FontAwesomeIcon

View File

@ -250,7 +250,7 @@ export const ProfileListScreenInner = observer(
return (
<CenteredView sideBorders style={s.hContentRegion}>
<Header rkey={rkey} list={list} />
{list.error && <ErrorScreen error={list.error} />}
{list.error ? <ErrorScreen error={list.error} /> : null}
</CenteredView>
)
},