aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/conversation/conversation.js9
-rw-r--r--src/components/timeline/timeline.js17
-rw-r--r--src/components/user_profile/user_profile.js6
-rw-r--r--src/components/user_profile/user_profile.vue1
4 files changed, 20 insertions, 13 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 9d9f7bbe..7bad14a5 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -1,9 +1,8 @@
import { reduce, filter, sortBy } from 'lodash'
-import { statusType } from '../../modules/statuses.js'
import Status from '../status/status.vue'
const sortAndFilterConversation = (conversation) => {
- conversation = filter(conversation, (status) => statusType(status) !== 'retweet')
+ conversation = filter(conversation, (status) => status.type !== 'retweet')
return sortBy(conversation, 'id')
}
@@ -18,10 +17,12 @@ const conversation = {
'collapsable'
],
computed: {
- status () { return this.statusoid },
+ status () {
+ return this.statusoid
+ },
conversation () {
if (!this.status) {
- return false
+ return []
}
const conversationId = this.status.statusnet_conversation_id
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 98da8660..23d2c1e8 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -7,7 +7,6 @@ import { throttle } from 'lodash'
const Timeline = {
props: [
'timeline',
- 'timelineName',
'title',
'userId',
'tag',
@@ -55,7 +54,7 @@ const Timeline = {
timelineFetcher.fetchAndUpdate({
store,
credentials,
- timeline: this.timelineName,
+ timeline: this.timeline,
showImmediately,
userId: this.userId,
tag: this.tag
@@ -70,32 +69,32 @@ const Timeline = {
destroyed () {
window.removeEventListener('scroll', this.scrollLoad)
if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false)
- this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
+ this.$store.commit('setLoading', { timeline: this.timeline, value: false })
},
methods: {
showNewStatuses () {
if (this.timeline.flushMarker !== 0) {
- this.$store.commit('clearTimeline', { timeline: this.timelineName })
- this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
+ this.$store.commit('clearTimeline', { timeline: this.timeline })
+ this.$store.commit('queueFlush', { timeline: this.timeline, id: 0 })
this.fetchOlderStatuses()
} else {
- this.$store.commit('showNewStatuses', { timeline: this.timelineName })
+ this.$store.commit('showNewStatuses', { timeline: this.timeline })
this.paused = false
}
},
fetchOlderStatuses: throttle(function () {
const store = this.$store
const credentials = store.state.users.currentUser.credentials
- store.commit('setLoading', { timeline: this.timelineName, value: true })
+ store.commit('setLoading', { timeline: this.timeline, value: true })
timelineFetcher.fetchAndUpdate({
store,
credentials,
- timeline: this.timelineName,
+ timeline: this.timeline,
older: true,
showImmediately: true,
userId: this.userId,
tag: this.tag
- }).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false }))
+ }).then(() => store.commit('setLoading', { timeline: this.timeline, value: false }))
}, 1000, this),
scrollLoad (e) {
const bodyBRect = document.body.getBoundingClientRect()
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index bde20707..245d55ca 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -1,6 +1,7 @@
import UserCardContent from '../user_card_content/user_card_content.vue'
import UserCard from '../user_card/user_card.vue'
import Timeline from '../timeline/timeline.vue'
+import { emptyTl } from '../../modules/statuses.js'
const UserProfile = {
created () {
@@ -13,6 +14,11 @@ const UserProfile = {
destroyed () {
this.$store.dispatch('stopFetching', 'user')
},
+ data () {
+ return {
+ favorites: emptyTl({ type: 'favorites', userId: this.userId })
+ }
+ },
computed: {
timeline () {
return this.$store.state.statuses.timelines.user
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 50619026..265fc65b 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -20,6 +20,7 @@
<i class="icon-spin3 animate-spin"></i>
</div>
</div>
+ <Timeline :label="$t('user_card.favorites')" :embedded="true" :title="$t('user_profile.favorites_title')" :timeline="favorites"/>
</tab-switcher>
</div>
<div v-else class="panel user-profile-placeholder">