dont fetch favs if profile isnt us

This commit is contained in:
shpuld 2019-01-28 16:59:01 +02:00
parent 6e945ee14b
commit 82ef57cd59

View file

@ -8,8 +8,8 @@ const UserProfile = {
this.$store.commit('clearTimeline', { timeline: 'favorites' }) this.$store.commit('clearTimeline', { timeline: 'favorites' })
this.$store.commit('clearTimeline', { timeline: 'media' }) this.$store.commit('clearTimeline', { timeline: 'media' })
this.$store.dispatch('startFetching', ['user', this.fetchBy]) this.$store.dispatch('startFetching', ['user', this.fetchBy])
this.$store.dispatch('startFetching', ['favorites', this.fetchBy])
this.$store.dispatch('startFetching', ['media', this.fetchBy]) this.$store.dispatch('startFetching', ['media', this.fetchBy])
this.startFetchFavorites()
if (!this.user.id) { if (!this.user.id) {
this.$store.dispatch('fetchUser', this.fetchBy) this.$store.dispatch('fetchUser', this.fetchBy)
} }
@ -74,6 +74,11 @@ const UserProfile = {
fetchFriends () { fetchFriends () {
const id = this.userId const id = this.userId
this.$store.dispatch('addFriends', { id }) this.$store.dispatch('addFriends', { id })
},
startFetchFavorites () {
if (this.isUs) {
this.$store.dispatch('startFetching', ['favorites', this.fetchBy])
}
} }
}, },
watch: { watch: {
@ -89,8 +94,8 @@ const UserProfile = {
this.$store.commit('clearTimeline', { timeline: 'favorites' }) this.$store.commit('clearTimeline', { timeline: 'favorites' })
this.$store.commit('clearTimeline', { timeline: 'media' }) this.$store.commit('clearTimeline', { timeline: 'media' })
this.$store.dispatch('startFetching', ['user', this.fetchBy]) this.$store.dispatch('startFetching', ['user', this.fetchBy])
this.$store.dispatch('startFetching', ['favorites', this.fetchBy])
this.$store.dispatch('startFetching', ['media', this.fetchBy]) this.$store.dispatch('startFetching', ['media', this.fetchBy])
this.startFetchFavorites()
}, },
userId () { userId () {
if (!this.isExternal) { if (!this.isExternal) {
@ -103,8 +108,8 @@ const UserProfile = {
this.$store.commit('clearTimeline', { timeline: 'favorites' }) this.$store.commit('clearTimeline', { timeline: 'favorites' })
this.$store.commit('clearTimeline', { timeline: 'media' }) this.$store.commit('clearTimeline', { timeline: 'media' })
this.$store.dispatch('startFetching', ['user', this.fetchBy]) this.$store.dispatch('startFetching', ['user', this.fetchBy])
this.$store.dispatch('startFetching', ['favorites', this.fetchBy])
this.$store.dispatch('startFetching', ['media', this.fetchBy]) this.$store.dispatch('startFetching', ['media', this.fetchBy])
this.startFetchFavorites()
}, },
user () { user () {
if (this.user.id && !this.user.followers) { if (this.user.id && !this.user.followers) {