From 76662ca557a3ae16e23273863ad82f7d7aea8ede Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 27 Feb 2020 14:06:29 -0500 Subject: [PATCH] Check for pictshare status ok. --- ui/src/components/post-listing.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index 56c1f0d..ef1dfd6 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -818,12 +818,19 @@ export class PostListing extends Component { ) .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); }); } })