move early return to after all hooks (#823)
parent
54e5e30945
commit
5c25d670d0
|
@ -7,7 +7,7 @@ import {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
FontAwesomeIconStyle,
|
FontAwesomeIconStyle,
|
||||||
} from '@fortawesome/react-native-fontawesome'
|
} from '@fortawesome/react-native-fontawesome'
|
||||||
import {PostsFeedItemModel} from 'state/models/feeds/posts'
|
import {PostsFeedItemModel} from 'state/models/feeds/post'
|
||||||
import {ModerationBehaviorCode} from 'lib/labeling/types'
|
import {ModerationBehaviorCode} from 'lib/labeling/types'
|
||||||
import {Link, DesktopWebTextLink} from '../util/Link'
|
import {Link, DesktopWebTextLink} from '../util/Link'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
|
@ -135,10 +135,6 @@ export const FeedItem = observer(function ({
|
||||||
)
|
)
|
||||||
}, [track, item, setDeleted, store])
|
}, [track, item, setDeleted, store])
|
||||||
|
|
||||||
if (!record || deleted) {
|
|
||||||
return <View />
|
|
||||||
}
|
|
||||||
|
|
||||||
const isSmallTop = isThreadChild
|
const isSmallTop = isThreadChild
|
||||||
const outerStyles = [
|
const outerStyles = [
|
||||||
styles.outer,
|
styles.outer,
|
||||||
|
@ -192,6 +188,10 @@ export const FeedItem = observer(function ({
|
||||||
[onPressReply, onPressToggleLike, onPressToggleRepost],
|
[onPressReply, onPressToggleLike, onPressToggleRepost],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!record || deleted) {
|
||||||
|
return <View />
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PostHider
|
<PostHider
|
||||||
testID={`feedItem-by-${item.post.author.handle}`}
|
testID={`feedItem-by-${item.post.author.handle}`}
|
||||||
|
|
Loading…
Reference in New Issue