From 835a9a5b28b90a17d45ef63e3e440dcf2270ffb2 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 4 Feb 2018 10:55:10 -0800 Subject: [PATCH] refactor status some more --- routes/_components/status/Status.html | 14 +++++--------- .../_components/status/StatusMediaAttachments.html | 1 + 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/routes/_components/status/Status.html b/routes/_components/status/Status.html index f0234db8..ea8fa07a 100644 --- a/routes/_components/status/Status.html +++ b/routes/_components/status/Status.html @@ -13,12 +13,8 @@ {{#if !originalStatus.spoiler_text || spoilerShown}} {{/if}} - {{#if originalStatusMediaAttachments && originalStatusMediaAttachments.length}} - + {{#if hasMedia}} + {{/if}} @@ -74,11 +70,11 @@ }, store: () => store, computed: { - isStatusInContext: (timelineType, timelineValue, statusId) => timelineType === 'status' && timelineValue === statusId, originalStatus: (status) => status.reblog ? status.reblog : status, - originalAccount: (originalStatus) => originalStatus.account, - originalStatusMediaAttachments: (originalStatus) => originalStatus.media_attachments, statusId: (originalStatus) => originalStatus.id, + hasMedia: (originalStatus) => originalStatus.media_attachments && originalStatus.media_attachments.length, + isStatusInContext: (timelineType, timelineValue, statusId) => timelineType === 'status' && timelineValue === statusId, + originalAccount: (originalStatus) => originalStatus.account, spoilerShown: ($spoilersShown, $currentInstance, statusId) => $spoilersShown && $spoilersShown[$currentInstance] && $spoilersShown[$currentInstance][statusId] } } diff --git a/routes/_components/status/StatusMediaAttachments.html b/routes/_components/status/StatusMediaAttachments.html index 2e8546f1..c53074bd 100644 --- a/routes/_components/status/StatusMediaAttachments.html +++ b/routes/_components/status/StatusMediaAttachments.html @@ -119,6 +119,7 @@ }, store: () => store, computed: { + mediaAttachments: (status) => status.media_attachments, sensitiveShown: ($sensitivesShown, $currentInstance, statusId) => { return $sensitivesShown && $sensitivesShown[$currentInstance] && $sensitivesShown[$currentInstance][statusId] },