summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-18 09:00:17 -0500
committerDessalines <tyhou13@gmx.com>2020-02-18 09:00:17 -0500
commit59ab341a2805bfe029d8e73fef4eaa12f5de9f30 (patch)
treecd8d03bf4ffb9831a0d05da29514b39eb389ec94 /ui
parent2062d07eb7834313bebaf27e69c8506c206fc68c (diff)
Fix iframely always refetching bug.
Diffstat (limited to 'ui')
-rw-r--r--ui/src/components/post-listing.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index 7b3d6479..50e1f30c 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -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);