aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_profile/user_profile.js
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2019-01-28 16:59:01 +0200
committershpuld <shp@cock.li>2019-01-28 16:59:01 +0200
commit82ef57cd59749febd83ffc0aacd0057c409cef73 (patch)
tree83183640f15f942bf7ee7ab8866c86e4677cc019 /src/components/user_profile/user_profile.js
parent6e945ee14bc4e603df3a70d51f6aeadfeeac737e (diff)
dont fetch favs if profile isnt us
Diffstat (limited to 'src/components/user_profile/user_profile.js')
-rw-r--r--src/components/user_profile/user_profile.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 7414e573..991062cd 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) {