diff options
| author | Henry Jameson <me@hjkos.com> | 2019-03-09 01:36:35 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-03-09 01:51:36 +0200 |
| commit | a02a74e9b9b999cd6c640c541dfbfcff3b2ebd9a (patch) | |
| tree | dbb638e855cbcb13fcbcf8b1d9fc62ca17b639cc | |
| parent | fe624f6114220320e1528981af83fb7ab39c0e67 (diff) | |
attempt at fixing switching to user TL
| -rw-r--r-- | src/components/status/status.js | 4 | ||||
| -rw-r--r-- | src/components/user_profile/user_profile.js | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 43572fe8..c90da6d4 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -145,11 +145,11 @@ const Status = { return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id) }, replyToName () { - const user = this.$store.getters.findUser(this.status.in_reply_to_user_id) if (this.status.in_reply_to_screen_name) { return this.status.in_reply_to_screen_name } else { - return user.screen_name + const user = this.$store.getters.findUser(this.status.in_reply_to_user_id) + return user && user.screen_name } }, hideReply () { 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') |
