Fix replies to deleted posts/users pushing vue warnings

This commit is contained in:
shpuld 2019-01-27 11:31:23 +02:00
parent 2d94a49798
commit ff5f5095df

View file

@ -74,6 +74,9 @@ const Status = {
(this.$store.state.config.hideAttachmentsInConv && this.inConversation) (this.$store.state.config.hideAttachmentsInConv && this.inConversation)
}, },
userProfileLink () { userProfileLink () {
if (this.status.user.screen_name === null) {
console.log(this.status.user)
}
return this.generateUserProfileLink(this.status.user.id, this.status.user.screen_name) return this.generateUserProfileLink(this.status.user.id, this.status.user.screen_name)
}, },
replyProfileLink () { replyProfileLink () {
@ -125,7 +128,7 @@ const Status = {
return lengthScore > 20 return lengthScore > 20
}, },
isReply () { isReply () {
return !!this.status.in_reply_to_status_id return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id)
}, },
replyToName () { replyToName () {
const user = this.$store.state.users.usersObject[this.status.in_reply_to_user_id] const user = this.$store.state.users.usersObject[this.status.in_reply_to_user_id]
@ -294,6 +297,9 @@ const Status = {
this.showPreview = false this.showPreview = false
}, },
generateUserProfileLink (id, name) { generateUserProfileLink (id, name) {
if (!name) {
console.log(id, name)
}
return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames) return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames)
} }
}, },