Prevent observer from observing while loading posts
This commit is contained in:
parent
a4f5a7bdd7
commit
40a0b72d87
2 changed files with 1 additions and 4 deletions
|
|
@ -34,9 +34,6 @@ class PostItem extends React.Component {
|
||||||
ruleUrl = `${this.props.feedUrl}/${rule.id}/`;
|
ruleUrl = `${this.props.feedUrl}/${rule.id}/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
/* TODO: figure out why this is called up to three times */
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<li className="posts__item" ref={this.props.forwardedRef}>
|
<li className="posts__item" ref={this.props.forwardedRef}>
|
||||||
<h5
|
<h5
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class PostList extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
if (this.lastPostRef.current) {
|
if (this.lastPostRef.current && !this.props.isFetching) {
|
||||||
this.observer.observe(this.lastPostRef.current);
|
this.observer.observe(this.lastPostRef.current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue