diff options
| author | eal <eal@waifu.club> | 2017-11-14 18:08:03 +0200 |
|---|---|---|
| committer | eal <eal@waifu.club> | 2017-11-14 18:08:03 +0200 |
| commit | 07057043d96cef9d3a0087f46fa4ff14a1f6788f (patch) | |
| tree | 79c675cd1c36a20eb300237adeb8b31f90f24f9a /src/components/user_profile/user_profile.js | |
| parent | 55c481808477fdbc4c56edf22e27336b5e27d3fb (diff) | |
Use state object for user view instead of timeline.
Also fetch user if not in the state already.
Diffstat (limited to 'src/components/user_profile/user_profile.js')
| -rw-r--r-- | src/components/user_profile/user_profile.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 48a8a073..26be1801 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -5,6 +5,9 @@ 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) + } }, destroyed () { this.$store.dispatch('stopFetching', 'user') @@ -18,7 +21,7 @@ const UserProfile = { if (this.timeline.statuses[0]) { return this.timeline.statuses[0].user } else { - return false + return this.$store.state.users.usersObject[this.userId] || false } } }, |
