From a02a74e9b9b999cd6c640c541dfbfcff3b2ebd9a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 9 Mar 2019 01:36:35 +0200 Subject: attempt at fixing switching to user TL --- src/components/user_profile/user_profile.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/components/user_profile/user_profile.js') diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 0f387f66..dc9cdeeb 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -38,6 +38,9 @@ const UserProfile = { created () { if (!this.user.id) { this.fetchUserId() + .then(() => this.startUp()) + } else { + this.startUp() } }, destroyed () { @@ -116,9 +119,11 @@ const UserProfile = { .then(() => this.startUp()) }, startUp () { - this.$store.dispatch('startFetching', { timeline: 'user', userId: this.userId }) - this.$store.dispatch('startFetching', { timeline: 'media', userId: this.userId }) - this.startFetchFavorites() + if (this.userId) { + this.$store.dispatch('startFetching', { timeline: 'user', userId: this.userId }) + this.$store.dispatch('startFetching', { timeline: 'media', userId: this.userId }) + this.startFetchFavorites() + } }, cleanUp () { this.$store.dispatch('stopFetching', 'user') -- cgit v1.2.3-70-g09d2