From efacfec3ed37c200bf5bad05b59e04a9f97d0d08 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Sun, 25 Jun 2017 13:57:52 -0700 Subject: [PATCH] Media previews for collapsed toots --- app/javascript/mastodon/components/status.js | 5 ++++- app/javascript/styles/components.scss | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index d795ff000..ec9b2a255 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -175,6 +175,7 @@ class StatusUnextended extends ImmutablePureComponent { render () { let media = null; + let thumb = null; let statusAvatar; // Exclude intersectionObserverWrapper from `other` variable @@ -221,8 +222,10 @@ class StatusUnextended extends ImmutablePureComponent { } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { media = ; + if (!status.get('sensitive')) thumb = status.getIn(['media_attachments', 0]).get('preview_url'); } else { media = ; + if (!status.get('sensitive')) thumb = status.getIn(['media_attachments', 0]).get('preview_url'); } } @@ -233,7 +236,7 @@ class StatusUnextended extends ImmutablePureComponent { } return ( -
+