Fix missing code from "delay post list for animation frame" (#1497)
* Fix missing code from "delay post list for animation frame" * fix * move setState elsewhere * update * fix * eslint * remove some diff
This commit is contained in:
parent
39774f8c20
commit
c20a01a0a2
1 changed files with 7 additions and 1 deletions
|
|
@ -54,6 +54,7 @@ export default class ChannelPostList extends PureComponent {
|
|||
const {postIds: nextPostIds} = nextProps;
|
||||
|
||||
let visiblePostIds = this.state.visiblePostIds;
|
||||
const channelSwitch = nextProps.channelId !== this.props.channelId;
|
||||
|
||||
if (nextPostIds !== this.props.postIds || nextProps.postVisibility !== this.props.postVisibility) {
|
||||
visiblePostIds = this.getVisiblePostIds(nextProps);
|
||||
|
|
@ -61,7 +62,12 @@ export default class ChannelPostList extends PureComponent {
|
|||
|
||||
this.setState({
|
||||
visiblePostIds,
|
||||
});
|
||||
loading: channelSwitch,
|
||||
}, () => InteractionManager.runAfterInteractions(() => {
|
||||
if (channelSwitch) {
|
||||
this.setState({loading: false});
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue