From 82ef57cd59749febd83ffc0aacd0057c409cef73 Mon Sep 17 00:00:00 2001 From: shpuld Date: Mon, 28 Jan 2019 16:59:01 +0200 Subject: [PATCH] dont fetch favs if profile isnt us --- src/components/user_profile/user_profile.js | 11 ++++++++--- 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 index 7414e57368..991062cd27 100644 --- 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) {