From c1dc69a038a598a5b66182ec81051f92040527b4 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Thu, 6 Dec 2018 21:29:02 +0300 Subject: [PATCH] Pass userName instead of userId --- src/components/user_profile/user_profile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 24a8cce9..8a32392a 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -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: {