fix repeated status opening

This commit is contained in:
Henry Jameson 2026-07-23 16:07:07 +03:00
commit 7bfd468346

View file

@ -77,25 +77,26 @@ const ChatMessage = {
return this.author.id === this.currentUser.id return this.author.id === this.currentUser.id
}, },
message() { message() {
return this.isMessage ? this.chatItem.data : null if (!this.isMessage) return null
return this.chatItem.data.retweeted_status ?? this.chatItem.data
}, },
isMessage() { isMessage() {
return this.chatItem.type === 'message' return this.chatItem.type === 'message'
}, },
isCustomReply() { isCustomReply() {
if (!this.previousItem) return false if (!this.previousItem) return false
if (!this.chatItem.data.in_reply_to_status_id) return false if (!this.message.in_reply_to_status_id) return false
return ( return (
this.previousItem.data.id !== this.chatItem.data.in_reply_to_status_id this.previousItem.data.id !== this.message.in_reply_to_status_id
) )
}, },
isBrokenReply() { isBrokenReply() {
if (!this.previousItem) return false if (!this.previousItem) return false
return !this.chatItem.data.in_reply_to_status_id return !this.message.in_reply_to_status_id
}, },
customReplyTo() { customReplyTo() {
return this.$store.state.statuses.allStatusesObject[ return this.$store.state.statuses.allStatusesObject[
this.chatItem.data.in_reply_to_status_id this.message.in_reply_to_status_id
] ]
}, },
replyToName() { replyToName() {
@ -201,8 +202,8 @@ const ChatMessage = {
const confirmed = window.confirm(this.$t('chats.delete_confirm')) const confirmed = window.confirm(this.$t('chats.delete_confirm'))
if (confirmed) { if (confirmed) {
await this.$emit('delete', { await this.$emit('delete', {
messageId: this.chatItem.data.id, messageId: this.message.id,
chatId: this.chatItem.data.chat_id, chatId: this.message.chat_id,
}) })
} }
this.hovered = false this.hovered = false