From d5cf3e557098973daac48bd46fcbe089240b28f0 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 d795ff000c..ec9b2a255b 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 ( -
+