attempt at fixing switching to user TL

This commit is contained in:
Henry Jameson 2019-03-09 01:36:35 +02:00
parent fe624f6114
commit a02a74e9b9
2 changed files with 10 additions and 5 deletions

View File

@ -145,11 +145,11 @@ const Status = {
return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id) return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id)
}, },
replyToName () { replyToName () {
const user = this.$store.getters.findUser(this.status.in_reply_to_user_id)
if (this.status.in_reply_to_screen_name) { if (this.status.in_reply_to_screen_name) {
return this.status.in_reply_to_screen_name return this.status.in_reply_to_screen_name
} else { } else {
return user.screen_name const user = this.$store.getters.findUser(this.status.in_reply_to_user_id)
return user && user.screen_name
} }
}, },
hideReply () { hideReply () {

View File

@ -38,6 +38,9 @@ const UserProfile = {
created () { created () {
if (!this.user.id) { if (!this.user.id) {
this.fetchUserId() this.fetchUserId()
.then(() => this.startUp())
} else {
this.startUp()
} }
}, },
destroyed () { destroyed () {
@ -116,9 +119,11 @@ const UserProfile = {
.then(() => this.startUp()) .then(() => this.startUp())
}, },
startUp () { startUp () {
if (this.userId) {
this.$store.dispatch('startFetching', { timeline: 'user', userId: this.userId }) this.$store.dispatch('startFetching', { timeline: 'user', userId: this.userId })
this.$store.dispatch('startFetching', { timeline: 'media', userId: this.userId }) this.$store.dispatch('startFetching', { timeline: 'media', userId: this.userId })
this.startFetchFavorites() this.startFetchFavorites()
}
}, },
cleanUp () { cleanUp () {
this.$store.dispatch('stopFetching', 'user') this.$store.dispatch('stopFetching', 'user')