Revert "some initial work to make it possible to use "unregistered" timelines, i.e. not"
and some stuff to make favorites still work
This reverts commit 039a407400
.
This commit is contained in:
parent
0f8baff5a3
commit
cab87744c8
6 changed files with 38 additions and 43 deletions
|
@ -7,6 +7,7 @@ import { throttle } from 'lodash'
|
|||
const Timeline = {
|
||||
props: [
|
||||
'timeline',
|
||||
'timelineName',
|
||||
'title',
|
||||
'userId',
|
||||
'tag',
|
||||
|
@ -54,7 +55,7 @@ const Timeline = {
|
|||
timelineFetcher.fetchAndUpdate({
|
||||
store,
|
||||
credentials,
|
||||
timeline: this.timeline,
|
||||
timeline: this.timelineName,
|
||||
showImmediately,
|
||||
userId: this.userId,
|
||||
tag: this.tag
|
||||
|
@ -69,32 +70,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.timeline, value: false })
|
||||
this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
|
||||
},
|
||||
methods: {
|
||||
showNewStatuses () {
|
||||
if (this.timeline.flushMarker !== 0) {
|
||||
this.$store.commit('clearTimeline', { timeline: this.timeline })
|
||||
this.$store.commit('queueFlush', { timeline: this.timeline, id: 0 })
|
||||
this.$store.commit('clearTimeline', { timeline: this.timelineName })
|
||||
this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
|
||||
this.fetchOlderStatuses()
|
||||
} else {
|
||||
this.$store.commit('showNewStatuses', { timeline: this.timeline })
|
||||
this.$store.commit('showNewStatuses', { timeline: this.timelineName })
|
||||
this.paused = false
|
||||
}
|
||||
},
|
||||
fetchOlderStatuses: throttle(function () {
|
||||
const store = this.$store
|
||||
const credentials = store.state.users.currentUser.credentials
|
||||
store.commit('setLoading', { timeline: this.timeline, value: true })
|
||||
store.commit('setLoading', { timeline: this.timelineName, value: true })
|
||||
timelineFetcher.fetchAndUpdate({
|
||||
store,
|
||||
credentials,
|
||||
timeline: this.timeline,
|
||||
timeline: this.timelineName,
|
||||
older: true,
|
||||
showImmediately: true,
|
||||
userId: this.userId,
|
||||
tag: this.tag
|
||||
}).then(() => store.commit('setLoading', { timeline: this.timeline, value: false }))
|
||||
}).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false }))
|
||||
}, 1000, this),
|
||||
scrollLoad (e) {
|
||||
const bodyBRect = document.body.getBoundingClientRect()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
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 () {
|
||||
|
@ -14,15 +13,13 @@ 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
|
||||
},
|
||||
favorites () {
|
||||
return this.$store.state.statuses.timelines.favorites
|
||||
},
|
||||
userId () {
|
||||
return this.$route.params.id || this.user.id
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue