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/user_profile/user_profile.vue | 1 +
 1 file changed, 1 insertion(+)

(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 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 4826d7254954390f13b1aa33e740e4f4d3598908 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Fri, 19 Jul 2019 21:48:09 -0400
Subject: update prop name

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

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

diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 55602c7b..7c8a761a 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -12,7 +12,7 @@ const Timeline = {
     'tag',
     'embedded',
     'count',
-    'excludedStatusIds'
+    'pinnedStatusIds'
   ],
   data () {
     return {
@@ -42,8 +42,8 @@ const Timeline = {
       }
     },
     statuses () {
-      if (this.excludedStatusIds && this.excludedStatusIds.length > 0) {
-        return this.timeline.visibleStatuses && this.timeline.visibleStatuses.filter(status => !this.excludedStatusIds.includes(status.id))
+      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
       }
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 1723cffa..81c63d7e 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -34,6 +34,7 @@
             :timeline="timeline"
             :timeline-name="'user'"
             :user-id="userId"
+            :pinned-status-ids="user.pinnedStatuseIds"
           />
         </div>
         <div
@@ -75,7 +76,6 @@
           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/user_profile/user_profile.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 dca384f123576d92e478d61cb74117407081d41d Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Fri, 19 Jul 2019 22:47:40 -0400
Subject: update prop syntax

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

(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 f4b284e2..fc745d1a 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -20,7 +20,7 @@
             :embedded="true"
             :title="$t('user_profile.timeline_title')"
             :timeline="timeline"
-            :timeline-name="'user'"
+            timeline-name="user"
             :user-id="userId"
             :pinned-status-ids="user.pinnedStatuseIds"
           />
-- 
cgit v1.2.3-70-g09d2


From 876c6de8066d9ac708bb0cd8e4d4c5e60f9502a6 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Fri, 19 Jul 2019 22:49:29 -0400
Subject: fix typos

---
 src/components/user_profile/user_profile.vue                | 2 +-
 src/modules/users.js                                        | 6 +++---
 src/services/entity_normalizer/entity_normalizer.service.js | 2 +-
 3 files changed, 5 insertions(+), 5 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 fc745d1a..e862440e 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -22,7 +22,7 @@
             :timeline="timeline"
             timeline-name="user"
             :user-id="userId"
-            :pinned-status-ids="user.pinnedStatuseIds"
+            :pinned-status-ids="user.pinnedStatusIds"
           />
         </div>
         <div
diff --git a/src/modules/users.js b/src/modules/users.js
index 57d3a3e3..10def9cd 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -167,11 +167,11 @@ export const mutations = {
   },
   setPinned (state, status) {
     const user = state.usersObject[status.user.id]
-    const index = user.pinnedStatuseIds.indexOf(status.id)
+    const index = user.pinnedStatusIds.indexOf(status.id)
     if (status.pinned && index === -1) {
-      user.pinnedStatuseIds.push(status.id)
+      user.pinnedStatusIds.push(status.id)
     } else if (!status.pinned && index !== -1) {
-      user.pinnedStatuseIds.splice(index, 1)
+      user.pinnedStatusIds.splice(index, 1)
     }
   },
   setUserForStatus (state, status) {
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index de6664d1..8b4d2594 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -152,7 +152,7 @@ export const parseUser = (data) => {
   output.statuses_count = data.statuses_count
   output.friendIds = []
   output.followerIds = []
-  output.pinnedStatuseIds = []
+  output.pinnedStatusIds = []
 
   if (data.pleroma) {
     output.follow_request_count = data.pleroma.follow_request_count
-- 
cgit v1.2.3-70-g09d2


From b2bd128f059de44a0ec27591dbc0052f494887a1 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 25 Jul 2019 15:14:44 -0400
Subject: allow zooming avatar in profile panel header

---
 src/components/user_card/user_card.js        | 9 ++-------
 src/components/user_card/user_card.vue       | 4 ++--
 src/components/user_profile/user_profile.vue | 1 +
 3 files changed, 5 insertions(+), 9 deletions(-)

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

diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index 070af38a..82d3b835 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -5,10 +5,9 @@ import ModerationTools from '../moderation_tools/moderation_tools.vue'
 import { hex2rgb } from '../../services/color_convert/color_convert.js'
 import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
 import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
-import { isEqual } from 'lodash'
 
 export default {
-  props: [ 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered' ],
+  props: [ 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar' ],
   data () {
     return {
       followRequestInProgress: false,
@@ -101,10 +100,6 @@ export default {
       const validRole = rights.admin || rights.moderator
       const roleTitle = rights.admin ? 'admin' : 'moderator'
       return validRole && roleTitle
-    },
-    isActiveRoute () {
-      const profileRoute = this.userProfileLink(this.user)
-      return profileRoute.name === this.$route.name && isEqual(profileRoute.params, this.$route.params)
     }
   },
   components: {
@@ -168,7 +163,7 @@ export default {
     reportUser () {
       this.$store.dispatch('openUserReportingModal', this.user.id)
     },
-    enlargeAvatar () {
+    zoomAvatar () {
       const attachment = {
         url: this.user.profile_image_url_original,
         mimetype: 'image'
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 3c0bf0d4..3c200a7f 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -8,9 +8,9 @@
       <div class="user-info">
         <div class="container">
           <a
-            v-if="isActiveRoute"
+            v-if="allowZoomingAvatar"
             class="user-info-avatar-link"
-            @click="enlargeAvatar"
+            @click="zoomAvatar"
           >
             <UserAvatar
               :better-shadow="betterShadow"
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index e862440e..cffa28f1 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -8,6 +8,7 @@
         :user="user"
         :switcher="true"
         :selected="timeline.viewing"
+        :allow-zooming-avatar="true"
         rounded="top"
       />
       <tab-switcher
-- 
cgit v1.2.3-70-g09d2


From 7dfcabb5433a5eb805bbda6ef87390c6ed2d5372 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Sat, 10 Aug 2019 14:49:37 -0400
Subject: sync profile tab state with location query

---
 src/components/user_profile/user_profile.js  | 14 +++++++++++---
 src/components/user_profile/user_profile.vue | 29 ++++++++++++++++------------
 2 files changed, 28 insertions(+), 15 deletions(-)

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

diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 1250d6f1..00055707 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -22,16 +22,20 @@ const FriendList = withLoadMore({
   additionalPropNames: ['userId']
 })(List)
 
+const defaultTabKey = 'statuses'
+
 const UserProfile = {
   data () {
     return {
       error: false,
-      userId: null
+      userId: null,
+      tab: defaultTabKey
     }
   },
   created () {
     const routeParams = this.$route.params
     this.load(routeParams.name || routeParams.id)
+    this.tab = get(this.$route, 'query.tab', defaultTabKey)
   },
   destroyed () {
     this.stopFetching()
@@ -115,6 +119,10 @@ const UserProfile = {
     switchUser (userNameOrId) {
       this.stopFetching()
       this.load(userNameOrId)
+    },
+    onTabSwitch (tab) {
+      this.tab = tab
+      this.$router.replace({ query: { tab } })
     }
   },
   watch: {
@@ -128,8 +136,8 @@ const UserProfile = {
         this.switchUser(newVal)
       }
     },
-    $route () {
-      this.$refs.tabSwitcher.activateTab(0)()
+    '$route.query': function (newVal) {
+      this.tab = newVal.tab || defaultTabKey
     }
   },
   components: {
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index cffa28f1..42516916 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -12,22 +12,24 @@
         rounded="top"
       />
       <tab-switcher
-        ref="tabSwitcher"
+        :active-tab="tab"
         :render-only-focused="true"
+        :on-switch="onTabSwitch"
       >
-        <div :label="$t('user_card.statuses')">
-          <Timeline
-            :count="user.statuses_count"
-            :embedded="true"
-            :title="$t('user_profile.timeline_title')"
-            :timeline="timeline"
-            timeline-name="user"
-            :user-id="userId"
-            :pinned-status-ids="user.pinnedStatusIds"
-          />
-        </div>
+        <Timeline
+          key="statuses"
+          :label="$t('user_card.statuses')"
+          :count="user.statuses_count"
+          :embedded="true"
+          :title="$t('user_profile.timeline_title')"
+          :timeline="timeline"
+          timeline-name="user"
+          :user-id="userId"
+          :pinned-status-ids="user.pinnedStatusIds"
+        />
         <div
           v-if="followsTabVisible"
+          key="followees"
           :label="$t('user_card.followees')"
           :disabled="!user.friends_count"
         >
@@ -42,6 +44,7 @@
         </div>
         <div
           v-if="followersTabVisible"
+          key="followers"
           :label="$t('user_card.followers')"
           :disabled="!user.followers_count"
         >
@@ -58,6 +61,7 @@
           </FollowerList>
         </div>
         <Timeline
+          key="media"
           :label="$t('user_card.media')"
           :disabled="!media.visibleStatuses.length"
           :embedded="true"
@@ -68,6 +72,7 @@
         />
         <Timeline
           v-if="isUs"
+          key="favorites"
           :label="$t('user_card.favorites')"
           :disabled="!favorites.visibleStatuses.length"
           :embedded="true"
-- 
cgit v1.2.3-70-g09d2

