aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_profile/user_profile.js
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2019-01-28 19:02:46 +0200
committershpuld <shp@cock.li>2019-01-28 19:02:46 +0200
commit51024a2c8af9d88b07c050b7502fa62843aa4ba2 (patch)
tree4c6f61e08f209d6a89a8a7a5e58991c2445f9e13 /src/components/user_profile/user_profile.js
parent676acdbf82726cd78ce8611d4c6ba78c58b8fc4c (diff)
parentbb2ee04f04dac177407f7cfbc8709ed4cd9965ff (diff)
Merge branch 'develop' into feat/media-modal
Diffstat (limited to 'src/components/user_profile/user_profile.js')
-rw-r--r--src/components/user_profile/user_profile.js23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index c9197a1c..991062cd 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -6,8 +6,10 @@ const UserProfile = {
created () {
this.$store.commit('clearTimeline', { timeline: 'user' })
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)
}
@@ -15,6 +17,7 @@ const UserProfile = {
destroyed () {
this.$store.dispatch('stopFetching', 'user')
this.$store.dispatch('stopFetching', 'favorites')
+ this.$store.dispatch('stopFetching', 'media')
},
computed: {
timeline () {
@@ -23,6 +26,9 @@ const UserProfile = {
favorites () {
return this.$store.state.statuses.timelines.favorites
},
+ media () {
+ return this.$store.state.statuses.timelines.media
+ },
userId () {
return this.$route.params.id || this.user.id
},
@@ -68,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: {
@@ -78,10 +89,13 @@ const UserProfile = {
}
this.$store.dispatch('stopFetching', 'user')
this.$store.dispatch('stopFetching', 'favorites')
+ this.$store.dispatch('stopFetching', 'media')
this.$store.commit('clearTimeline', { timeline: 'user' })
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) {
@@ -89,10 +103,13 @@ const UserProfile = {
}
this.$store.dispatch('stopFetching', 'user')
this.$store.dispatch('stopFetching', 'favorites')
+ this.$store.dispatch('stopFetching', 'media')
this.$store.commit('clearTimeline', { timeline: 'user' })
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) {