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