logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: bb2ee04f04dac177407f7cfbc8709ed4cd9965ff
parent: 53712c1570fa1f603356161164a695dfeb5b53fa
Author: lambda <pleromagit@rogerbraun.net>
Date:   Mon, 28 Jan 2019 16:22:03 +0000

Merge branch 'fix/dont-fetch-favorites-for-others' into 'develop'

fix/don't fetch favs if the profile isnt current user

See merge request pleroma/pleroma-fe!484

Diffstat:

Msrc/components/user_profile/user_profile.js11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

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