mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 21:41:43 +00:00
Fix iframely always refetching bug.
This commit is contained in:
parent
2062d07eb7
commit
59ab341a28
1 changed files with 7 additions and 4 deletions
11
ui/src/components/post-listing.tsx
vendored
11
ui/src/components/post-listing.tsx
vendored
|
@ -101,11 +101,14 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
this.state.upvotes = nextProps.post.upvotes;
|
||||
this.state.downvotes = nextProps.post.downvotes;
|
||||
this.state.score = nextProps.post.score;
|
||||
this.state.url = nextProps.post.url;
|
||||
this.state.iframely = null;
|
||||
|
||||
if (nextProps.post.url) {
|
||||
this.fetchIframely();
|
||||
if (nextProps.post.url !== this.state.url) {
|
||||
this.state.url = nextProps.post.url;
|
||||
if (this.state.url) {
|
||||
this.fetchIframely();
|
||||
} else {
|
||||
this.state.iframely = null;
|
||||
}
|
||||
}
|
||||
|
||||
this.setState(this.state);
|
||||
|
|
Loading…
Reference in a new issue