From 28445e27b85b783ce5eba394f89e583a540cd88b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 28 May 2020 23:27:27 -0600 Subject: [PATCH] Add notification preview to NotificationCard --- .../assets/js/components/NotificationCard.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/components/NotificationCard.vue b/resources/assets/js/components/NotificationCard.vue index b5a03bc97..965189694 100644 --- a/resources/assets/js/components/NotificationCard.vue +++ b/resources/assets/js/components/NotificationCard.vue @@ -20,7 +20,16 @@

- {{truncate(n.account.username)}} liked your post. + {{truncate(n.account.username)}} liked your + + post. + + + + + + post. +

@@ -219,6 +228,13 @@ redirect(url) { window.location.href = url; + }, + + notificationPreview(n) { + if(!n.status.hasOwnProperty('media_attachments') || !n.status.media_attachments.length) { + return '/storage/no-preview.png'; + } + return n.status.media_attachments[0].preview_url; } } }