From fc9acf8fb660b04641a6c30114dfa5f245de6e8c Mon Sep 17 00:00:00 2001
From: Moonman <shitposterclub@gmail.com>
Date: Mon, 20 May 2019 00:03:50 -0400
Subject: add tags to data and to status component

---
 src/components/status/status.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/components/status/status.vue')

diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 997c1b31..24b2520f 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -32,7 +32,7 @@
         </div>
       </div>
 
-      <div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status">
+      <div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status" v-bind="generateTagAttributes(status.tags)">
         <div v-if="!noHeading" class="media-left">
           <router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
             <UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
-- 
cgit v1.2.3-70-g09d2


From 0f824ff311bd3b1b8a0126ad9d7a2885440d3762 Mon Sep 17 00:00:00 2001
From: Moonman <shitposterclub@gmail.com>
Date: Mon, 20 May 2019 15:23:36 -0400
Subject: switch from method to computed property

---
 src/components/status/status.js  | 10 +++-------
 src/components/status/status.vue |  2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)

(limited to 'src/components/status/status.vue')

diff --git a/src/components/status/status.js b/src/components/status/status.js
index e2d2bb8b..ea4c2b9d 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -274,6 +274,9 @@ const Status = {
     },
     ownStatus () {
       return this.status.user.id === this.$store.state.users.currentUser.id
+    },
+    tags () {
+      return this.status.tags.filter(tagObj => tagObj.hasOwnProperty('name')).map(tagObj => tagObj.name).join(' ')
     }
   },
   components: {
@@ -289,13 +292,6 @@ const Status = {
     AvatarList
   },
   methods: {
-    generateTagAttributes (tags) {
-      let res = {}
-      for (let tag of tags) {
-        res['data-tag-' + tag.name] = tag.name
-      }
-      return res
-    },
     visibilityIcon (visibility) {
       switch (visibility) {
         case 'private':
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 24b2520f..9a062592 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -32,7 +32,7 @@
         </div>
       </div>
 
-      <div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status" v-bind="generateTagAttributes(status.tags)">
+      <div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status" :data-tags="tags">
         <div v-if="!noHeading" class="media-left">
           <router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
             <UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
-- 
cgit v1.2.3-70-g09d2

