From 110c9d3b26e3871c8fc8157458be201ed4316d49 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Tue, 30 Apr 2019 08:20:19 -0400
Subject: improve performance by caching pinned status ids into user object

---
 src/components/user_profile/user_profile.vue | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

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

diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 1e104403..36d75b9e 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -5,13 +5,15 @@
     <tab-switcher :renderOnlyFocused="true" ref="tabSwitcher">
       <div :label="$t('user_card.statuses')" :disabled="!user.statuses_count">
         <div class="timeline">
-          <Conversation
-            v-for="status in pinnedStatuses"
-            class="status-fadein"
-            :key="status.id"
-            :statusoid="status"
-            :collapsable="true"
-          />
+          <template v-for="statusId in user.pinnedStatuseIds">
+            <Conversation
+              v-if="timeline.statusesObject[statusId]"
+              class="status-fadein"
+              :key="statusId"
+              :statusoid="timeline.statusesObject[statusId]"
+              :collapsable="true"
+            />
+          </template>
         </div>
         <Timeline
           :count="user.statuses_count"
-- 
cgit v1.2.3-70-g09d2

