From 7f9feacd264915df92d14399dc9c1aa5cb4d22e7 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Sun, 26 May 2019 14:15:35 -0400
Subject: prevent showing pinned statuses twice

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

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

diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 1fc52083..623f65d7 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -29,7 +29,7 @@
     <div :class="classes.body">
       <div class="timeline">
         <conversation
-          v-for="status in timeline.visibleStatuses"
+          v-for="status in statuses"
           :key="status.id"
           class="status-fadein"
           :statusoid="status"
-- 
cgit v1.2.3-70-g09d2


From ae829e8df13f2b9c18b3e5488ebe265e2669e759 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Fri, 19 Jul 2019 22:40:37 -0400
Subject: move pinned statuses showing logic in timeline

---
 src/components/timeline/timeline.vue         | 12 ++++++++++++
 src/components/user_profile/user_profile.vue | 12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)

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

diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 623f65d7..9990f20a 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -27,6 +27,18 @@
       </div>
     </div>
     <div :class="classes.body">
+      <div class="timeline">
+        <template v-for="statusId in pinnedStatusIds">
+          <conversation
+            v-if="timeline.statusesObject[statusId]"
+            :key="statusId"
+            class="status-fadein"
+            :statusoid="timeline.statusesObject[statusId]"
+            :collapsable="true"
+            :show-pinned="true"
+          />
+        </template>
+      </div>
       <div class="timeline">
         <conversation
           v-for="status in statuses"
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 81c63d7e..f4b284e2 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -15,18 +15,6 @@
         :render-only-focused="true"
       >
         <div :label="$t('user_card.statuses')">
-          <div class="timeline">
-            <template v-for="statusId in user.pinnedStatuseIds">
-              <Conversation
-                v-if="timeline.statusesObject[statusId]"
-                :key="statusId"
-                class="status-fadein"
-                :statusoid="timeline.statusesObject[statusId]"
-                :collapsable="true"
-                :show-pinned="true"
-              />
-            </template>
-          </div>
           <Timeline
             :count="user.statuses_count"
             :embedded="true"
-- 
cgit v1.2.3-70-g09d2


From d7dc07066734fc69ef01022f92f57ededbbd0777 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Fri, 19 Jul 2019 22:46:11 -0400
Subject: put two loops in one parent

---
 src/components/timeline/timeline.vue | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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

diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 9990f20a..4337ac36 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -31,15 +31,13 @@
         <template v-for="statusId in pinnedStatusIds">
           <conversation
             v-if="timeline.statusesObject[statusId]"
-            :key="statusId"
+            :key="statusId + '-pinned'"
             class="status-fadein"
             :statusoid="timeline.statusesObject[statusId]"
             :collapsable="true"
             :show-pinned="true"
           />
         </template>
-      </div>
-      <div class="timeline">
         <conversation
           v-for="status in statuses"
           :key="status.id"
-- 
cgit v1.2.3-70-g09d2


From 0f8ace483649c1da66a1270373a3b95683ff9a0b Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Sat, 20 Jul 2019 16:54:30 -0400
Subject: update status eliminating logic

---
 src/components/timeline/timeline.js  | 14 ++++++++++----
 src/components/timeline/timeline.vue | 16 +++++++++-------
 2 files changed, 19 insertions(+), 11 deletions(-)

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

diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 7c8a761a..b1413591 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -41,12 +41,18 @@ const Timeline = {
         footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : [])
       }
     },
-    statuses () {
+    // id map of statuses which need to be hidden in the main list due to pinning logic
+    excludedStatusIdsObject () {
+      const result = {}
       if (this.pinnedStatusIds && this.pinnedStatusIds.length > 0) {
-        return this.timeline.visibleStatuses && this.timeline.visibleStatuses.filter(status => !this.pinnedStatusIds.includes(status.id))
-      } else {
-        return this.timeline.visibleStatuses
+        for (let status of this.timeline.visibleStatuses) {
+          if (this.pinnedStatusIds.indexOf(status.id) === -1) {
+            break
+          }
+          result[status.id] = true
+        }
       }
+      return result
     }
   },
   components: {
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 4337ac36..0cb4b3ef 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -38,13 +38,15 @@
             :show-pinned="true"
           />
         </template>
-        <conversation
-          v-for="status in statuses"
-          :key="status.id"
-          class="status-fadein"
-          :statusoid="status"
-          :collapsable="true"
-        />
+        <template v-for="status in timeline.visibleStatuses">
+          <conversation
+            v-if="!excludedStatusIdsObject[status.id]"
+            :key="status.id"
+            class="status-fadein"
+            :statusoid="status"
+            :collapsable="true"
+          />
+        </template>
       </div>
     </div>
     <div :class="classes.footer">
-- 
cgit v1.2.3-70-g09d2

