From 8d6750d9c2816e33a0444cd978f94009d8b85d47 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Fri, 5 Jul 2019 10:17:44 +0300
Subject: eslint --fix --ext .js,.vue src

---
 src/components/timeline/timeline.vue | 57 ++++++++++++++++++++++++++----------
 1 file changed, 41 insertions(+), 16 deletions(-)

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

diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index e6a8d458..1fc52083 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -2,41 +2,66 @@
   <div :class="classes.root">
     <div :class="classes.header">
       <div class="title">
-        {{title}}
+        {{ title }}
       </div>
-      <div @click.prevent class="loadmore-error alert error" v-if="timelineError">
-        {{$t('timeline.error_fetching')}}
+      <div
+        v-if="timelineError"
+        class="loadmore-error alert error"
+        @click.prevent
+      >
+        {{ $t('timeline.error_fetching') }}
       </div>
-      <button @click.prevent="showNewStatuses" class="loadmore-button" v-if="timeline.newStatusCount > 0 && !timelineError">
-        {{$t('timeline.show_new')}}{{newStatusCountStr}}
+      <button
+        v-if="timeline.newStatusCount > 0 && !timelineError"
+        class="loadmore-button"
+        @click.prevent="showNewStatuses"
+      >
+        {{ $t('timeline.show_new') }}{{ newStatusCountStr }}
       </button>
-      <div @click.prevent class="loadmore-text faint" v-if="!timeline.newStatusCount > 0 && !timelineError">
-        {{$t('timeline.up_to_date')}}
+      <div
+        v-if="!timeline.newStatusCount > 0 && !timelineError"
+        class="loadmore-text faint"
+        @click.prevent
+      >
+        {{ $t('timeline.up_to_date') }}
       </div>
     </div>
     <div :class="classes.body">
       <div class="timeline">
         <conversation
           v-for="status in timeline.visibleStatuses"
-          class="status-fadein"
           :key="status.id"
+          class="status-fadein"
           :statusoid="status"
           :collapsable="true"
         />
       </div>
     </div>
     <div :class="classes.footer">
-      <div v-if="count===0" class="new-status-notification text-center panel-footer faint">
-        {{$t('timeline.no_statuses')}}
+      <div
+        v-if="count===0"
+        class="new-status-notification text-center panel-footer faint"
+      >
+        {{ $t('timeline.no_statuses') }}
       </div>
-      <div v-else-if="bottomedOut" class="new-status-notification text-center panel-footer faint">
-        {{$t('timeline.no_more_statuses')}}
+      <div
+        v-else-if="bottomedOut"
+        class="new-status-notification text-center panel-footer faint"
+      >
+        {{ $t('timeline.no_more_statuses') }}
       </div>
-      <a v-else-if="!timeline.loading" href="#" v-on:click.prevent='fetchOlderStatuses()'>
-        <div class="new-status-notification text-center panel-footer">{{$t('timeline.load_older')}}</div>
+      <a
+        v-else-if="!timeline.loading"
+        href="#"
+        @click.prevent="fetchOlderStatuses()"
+      >
+        <div class="new-status-notification text-center panel-footer">{{ $t('timeline.load_older') }}</div>
       </a>
-      <div v-else class="new-status-notification text-center panel-footer">
-        <i class="icon-spin3 animate-spin"/>
+      <div
+        v-else
+        class="new-status-notification text-center panel-footer"
+      >
+        <i class="icon-spin3 animate-spin" />
       </div>
     </div>
   </div>
-- 
cgit v1.2.3-70-g09d2


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.js          | 10 +++++++++-
 src/components/timeline/timeline.vue         |  2 +-
 src/components/user_profile/user_profile.vue |  1 +
 3 files changed, 11 insertions(+), 2 deletions(-)

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

diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 5e24bd15..55602c7b 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -11,7 +11,8 @@ const Timeline = {
     'userId',
     'tag',
     'embedded',
-    'count'
+    'count',
+    'excludedStatusIds'
   ],
   data () {
     return {
@@ -39,6 +40,13 @@ const Timeline = {
         body: ['timeline-body'].concat(!this.embedded ? ['panel-body'] : []),
         footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : [])
       }
+    },
+    statuses () {
+      if (this.excludedStatusIds && this.excludedStatusIds.length > 0) {
+        return this.timeline.visibleStatuses && this.timeline.visibleStatuses.filter(status => !this.excludedStatusIds.includes(status.id))
+      } else {
+        return this.timeline.visibleStatuses
+      }
     }
   },
   components: {
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"
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 4ea0a869..1723cffa 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -75,6 +75,7 @@
           timeline-name="media"
           :timeline="media"
           :user-id="userId"
+          :excludedStatusIds="user.pinnedStatuseIds"
         />
         <Timeline
           v-if="isUs"
-- 
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


From 4b444708f2594028e47dad91f1e90728592474ae Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 15 Aug 2019 13:07:07 -0400
Subject: fix pin showing logic in conversation

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

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

diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index a2b3aeab..cb4db8ea 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -1,4 +1,4 @@
-import { reduce, filter, findIndex, clone } from 'lodash'
+import { reduce, filter, findIndex, clone, keyBy } from 'lodash'
 import Status from '../status/status.vue'
 
 const sortById = (a, b) => {
@@ -42,7 +42,7 @@ const conversation = {
     'statusoid',
     'collapsable',
     'isPage',
-    'showPinned'
+    'pinnedStatusIds'
   ],
   created () {
     if (this.isPage) {
@@ -104,6 +104,9 @@ const conversation = {
     },
     isExpanded () {
       return this.expanded || this.isPage
+    },
+    pinnedStatusIdsObject () {
+      return keyBy(this.pinnedStatusIds, id => id)
     }
   },
   components: {
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 5a900607..d4e199c1 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -21,7 +21,7 @@
       :inline-expanded="collapsable && isExpanded"
       :statusoid="status"
       :expandable="!isExpanded"
-      :show-pinned="showPinned"
+      :show-pinned="pinnedStatusIdsObject[status.id]"
       :focused="focused(status.id)"
       :in-conversation="isExpanded"
       :highlight="getHighlight()"
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index ab506632..64218f6e 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -32,7 +32,7 @@
     </template>
     <template v-else>
       <div
-        v-if="showPinned && statusoid.pinned"
+        v-if="showPinned"
         class="status-pin"
       >
         <i class="fa icon-pin faint" />
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 0cb4b3ef..23795bec 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -35,7 +35,7 @@
             class="status-fadein"
             :statusoid="timeline.statusesObject[statusId]"
             :collapsable="true"
-            :show-pinned="true"
+            :pinned-status-ids="pinnedStatusIds"
           />
         </template>
         <template v-for="status in timeline.visibleStatuses">
-- 
cgit v1.2.3-70-g09d2


From 1146119d6af4bdd3d15bd635806520df78504ad2 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 15 Aug 2019 13:16:55 -0400
Subject: generate idObj at timeline level

---
 src/components/conversation/conversation.js  | 7 ++-----
 src/components/conversation/conversation.vue | 2 +-
 src/components/timeline/timeline.js          | 3 +++
 src/components/timeline/timeline.vue         | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

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

diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index cb4db8ea..19dcb257 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -1,4 +1,4 @@
-import { reduce, filter, findIndex, clone, keyBy } from 'lodash'
+import { reduce, filter, findIndex, clone } from 'lodash'
 import Status from '../status/status.vue'
 
 const sortById = (a, b) => {
@@ -42,7 +42,7 @@ const conversation = {
     'statusoid',
     'collapsable',
     'isPage',
-    'pinnedStatusIds'
+    'pinnedStatusIdsObject'
   ],
   created () {
     if (this.isPage) {
@@ -104,9 +104,6 @@ const conversation = {
     },
     isExpanded () {
       return this.expanded || this.isPage
-    },
-    pinnedStatusIdsObject () {
-      return keyBy(this.pinnedStatusIds, id => id)
     }
   },
   components: {
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index d4e199c1..f184c071 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -21,7 +21,7 @@
       :inline-expanded="collapsable && isExpanded"
       :statusoid="status"
       :expandable="!isExpanded"
-      :show-pinned="pinnedStatusIdsObject[status.id]"
+      :show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
       :focused="focused(status.id)"
       :in-conversation="isExpanded"
       :highlight="getHighlight()"
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index aac3869f..2e317e8e 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -59,6 +59,9 @@ const Timeline = {
       const ids = getExcludedStatusIdsByPinning(this.timeline.visibleStatuses, this.pinnedStatusIds)
       // Convert id array to object
       return keyBy(ids, id => id)
+    },
+    pinnedStatusIdsObject () {
+      return keyBy(this.pinnedStatusIds, id => id)
     }
   },
   components: {
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 23795bec..4ad51714 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -35,7 +35,7 @@
             class="status-fadein"
             :statusoid="timeline.statusesObject[statusId]"
             :collapsable="true"
-            :pinned-status-ids="pinnedStatusIds"
+            :pinned-status-ids-object="pinnedStatusIdsObject"
           />
         </template>
         <template v-for="status in timeline.visibleStatuses">
-- 
cgit v1.2.3-70-g09d2

