Pass userName instead of userId

This commit is contained in:
Maxim Filippov 2018-12-06 21:29:02 +03:00
parent e576f8cdad
commit c1dc69a038
1 changed files with 4 additions and 4 deletions

View File

@ -4,9 +4,9 @@ import Timeline from '../timeline/timeline.vue'
const UserProfile = {
created () {
this.$store.commit('clearTimeline', { timeline: 'user' })
this.$store.dispatch('startFetching', ['user', this.userId])
if (!this.$store.state.users.usersObject[this.userId]) {
this.$store.dispatch('fetchUser', this.userId)
this.$store.dispatch('startFetching', ['user', this.userName])
if (!this.user) {
this.$store.dispatch('fetchUser', this.userName)
}
},
destroyed () {
@ -34,7 +34,7 @@ const UserProfile = {
userName () {
this.$store.dispatch('stopFetching', 'user')
this.$store.commit('clearTimeline', { timeline: 'user' })
this.$store.dispatch('startFetching', ['user', this.userId])
this.$store.dispatch('startFetching', ['user', this.userName])
}
},
components: {