aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_profile
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-04-24 13:56:53 -0400
committertaehoon <th.dev91@gmail.com>2019-05-15 12:04:25 -0400
commitcd0a7afa06cafc93510286d35a60e9e40ead36bf (patch)
tree91303c82172bab88bd9d5a91a0fb12ce4f05881a /src/components/user_profile
parent9e22d6212acaeba271d847b565d066ae92165d09 (diff)
remove pinned timeline, instead, use simple entity of user object
Diffstat (limited to 'src/components/user_profile')
-rw-r--r--src/components/user_profile/user_profile.js13
-rw-r--r--src/components/user_profile/user_profile.vue19
2 files changed, 17 insertions, 15 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 71a88dcf..0071fa89 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -2,6 +2,7 @@ import get from 'lodash/get'
import UserCard from '../user_card/user_card.vue'
import FollowCard from '../follow_card/follow_card.vue'
import Timeline from '../timeline/timeline.vue'
+import Conversation from '../conversation/conversation.vue'
import ModerationTools from '../moderation_tools/moderation_tools.vue'
import List from '../list/list.vue'
import withLoadMore from '../../hocs/with_load_more/with_load_more'
@@ -40,9 +41,6 @@ const UserProfile = {
timeline () {
return this.$store.state.statuses.timelines.user
},
- pinned () {
- return this.$store.state.statuses.timelines.pinned
- },
favorites () {
return this.$store.state.statuses.timelines.favorites
},
@@ -56,6 +54,9 @@ const UserProfile = {
user () {
return this.$store.getters.findUser(this.userId)
},
+ pinnedStatuses () {
+ return this.user.pinnedStatusIds.map(id => this.$store.state.statuses.allStatusesObject[id])
+ },
isExternal () {
return this.$route.name === 'external-user-profile'
},
@@ -94,15 +95,14 @@ const UserProfile = {
fetchTimelines () {
const userId = this.userId
this.$store.dispatch('startFetchingTimeline', { timeline: 'user', userId })
- this.$store.dispatch('startFetchingTimeline', { timeline: 'pinned', userId })
this.$store.dispatch('startFetchingTimeline', { timeline: 'media', userId })
if (this.isUs) {
this.$store.dispatch('startFetchingTimeline', { timeline: 'favorites', userId })
}
+ this.$store.dispatch('fetchPinnedStatuses', userId)
},
cleanUp () {
this.$store.dispatch('stopFetching', 'user')
- this.$store.dispatch('stopFetching', 'pinned')
this.$store.dispatch('stopFetching', 'favorites')
this.$store.dispatch('stopFetching', 'media')
this.$store.commit('clearTimeline', { timeline: 'user' })
@@ -133,7 +133,8 @@ const UserProfile = {
FollowerList,
FriendList,
ModerationTools,
- FollowCard
+ FollowCard,
+ Conversation
}
}
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index caf297c6..46561e2a 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -4,15 +4,16 @@
<UserCard :user="user" :switcher="true" :selected="timeline.viewing" rounded="top"/>
<tab-switcher :renderOnlyFocused="true" ref="tabSwitcher">
<div :label="$t('user_card.statuses')" :disabled="!user.statuses_count">
- <Timeline
- :count="user.statuses_count"
- :embedded="true"
- :title="$t('user_profile.timeline_title')"
- :timeline="pinned"
- :timeline-name="'pinned'"
- :user-id="userId"
- :no-load-more="true"
- />
+ <div class="timeline">
+ <Conversation
+ v-for="status in pinnedStatuses"
+ class="status-fadein"
+ :key="status.id"
+ :statusoid="status"
+ :pinned="true"
+ :collapsable="true"
+ />
+ </div>
<Timeline
:count="user.statuses_count"
:embedded="true"