summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-listing.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-27 14:06:29 -0500
committerDessalines <tyhou13@gmx.com>2020-02-27 14:06:29 -0500
commit862321aa3972d12d3d2ca2527c6aa573d078e99f (patch)
tree5e595671a3008f7b392c11469de0c40e926dfc78 /ui/src/components/post-listing.tsx
parent72c5bdbf9e788243df4b2ec1249495e4d7f4092c (diff)
Check for pictshare status ok.
Diffstat (limited to 'ui/src/components/post-listing.tsx')
-rw-r--r--ui/src/components/post-listing.tsx17
1 files changed, 12 insertions, 5 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index 56c1f0d9..ef1dfd60 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -818,12 +818,19 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
)
.then(res => res.json())
.then(res => {
- let url = `${window.location.origin}/pictshare/${res.url}`;
- if (res.filetype == 'mp4') {
- url += '/raw';
+ if (res.status == 'ok') {
+ let url = `${window.location.origin}/pictshare/${res.url}`;
+ if (res.filetype == 'mp4') {
+ url += '/raw';
+ }
+ this.state.thumbnail = url;
+ this.setState(this.state);
+ } else {
+ console.error(
+ `Couldn't cache pictshare url: ${this.state.iframely.thumbnail_url}`
+ );
+ console.error(res);
}
- this.state.thumbnail = url;
- this.setState(this.state);
});
}
})