diff --git a/app/definitions/IMessage.ts b/app/definitions/IMessage.ts index 4a86621d6..9d50054f3 100644 --- a/app/definitions/IMessage.ts +++ b/app/definitions/IMessage.ts @@ -12,7 +12,6 @@ export type MessageType = | 'jitsi_call_started' | 'discussion-created' | 'e2e' - | 'load_more' | 'rm' | 'uj' | MessageTypeLoad diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx index 259339cca..c56561ba2 100644 --- a/app/views/RoomView/List/index.tsx +++ b/app/views/RoomView/List/index.tsx @@ -19,7 +19,7 @@ import NavBottomFAB from './NavBottomFAB'; import { loadMissedMessages, loadThreadMessages } from '../../../lib/methods'; import { Services } from '../../../lib/services'; import { TSupportedThemes, withTheme } from '../../../theme'; -import { themes } from '../../../lib/constants'; +import { MESSAGE_TYPE_ANY_LOAD, themes } from '../../../lib/constants'; const QUERY_SIZE = 50; @@ -186,37 +186,44 @@ class ListContainer extends React.Component { // @ts-ignore is this enough cols? - messages = messages.map(m => ({ - id: m.id, - msg: m.msg, - ts: m.ts, - status: m.status, - attachments: m.attachments, - urls: m.urls, - reactions: m.reactions, - t: m.t, - avatar: m.avatar, - emoji: m.emoji, - u: m.u, - alias: m.alias, - editedBy: m.editedBy, - role: m.role, - drid: m.drid, - dcount: m.dcount, - dlm: m.dlm, - tmid: m.tmid, - tcount: m.tcount, - tlm: m.tlm, - tmsg: m.tmsg, - mentions: m.mentions, - channels: m.channels, - unread: m.unread, - blocks: m.blocks, - autoTranslate: m.autoTranslate, - replies: m.replies, - md: m.md, - comment: m.comment - })); + messages = messages.map(m => { + if (MESSAGE_TYPE_ANY_LOAD.includes(m.t)) { + return m; + } + + return { + id: m.id, + _id: m._id, + msg: m.msg, + ts: m.ts, + status: m.status, + attachments: m.attachments, + urls: m.urls, + reactions: m.reactions, + t: m.t, + avatar: m.avatar, + emoji: m.emoji, + u: m.u, + alias: m.alias, + editedBy: m.editedBy, + role: m.role, + drid: m.drid, + dcount: m.dcount, + dlm: m.dlm, + tmid: m.tmid, + tcount: m.tcount, + tlm: m.tlm, + tmsg: m.tmsg, + mentions: m.mentions, + channels: m.channels, + unread: m.unread, + blocks: m.blocks, + autoTranslate: m.autoTranslate, + replies: m.replies, + md: m.md, + comment: m.comment + }; + }); if (tmid && this.thread) { messages = [...messages, this.thread]; } @@ -233,7 +240,6 @@ class ListContainer extends React.Component this.update()); this.setState({ messages }); } else { // @ts-ignore @@ -284,13 +290,6 @@ class ListContainer extends React.Component { - if (this.animated) { - animateNextTransition(); - } - // this.forceUpdate(); - }; - unsubscribeMessages = () => { if (this.messagesSubscription && this.messagesSubscription.unsubscribe) { this.messagesSubscription.unsubscribe();