diff --git a/backend/src/graphql/messages.ts b/backend/src/graphql/messages.ts index 865f0c8cf..fde45083b 100644 --- a/backend/src/graphql/messages.ts +++ b/backend/src/graphql/messages.ts @@ -21,7 +21,7 @@ export const createMessageMutation = () => { export const messageQuery = () => { return gql` query ($roomId: ID!, $first: Int, $offset: Int) { - Message(roomId: $roomId, first: $first, offset: $offset, orderBy: createdAt_desc) { + Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) { _id id indexId diff --git a/backend/src/schema/types/type/Message.gql b/backend/src/schema/types/type/Message.gql index 671c5523a..764181dd9 100644 --- a/backend/src/schema/types/type/Message.gql +++ b/backend/src/schema/types/type/Message.gql @@ -3,8 +3,7 @@ # } enum _MessageOrdering { - createdAt_asc - createdAt_desc + indexId_desc } type Message { diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index dd39e7bcd..88d0b811c 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -120,20 +120,6 @@ export default { text: 'This is the action', }, ], - textMessages: { - ROOMS_EMPTY: this.$t('chat.roomsEmpty'), - ROOM_EMPTY: this.$t('chat.roomEmpty'), - NEW_MESSAGES: this.$t('chat.newMessages'), - MESSAGE_DELETED: this.$t('chat.messageDeleted'), - MESSAGES_EMPTY: this.$t('chat.messagesEmpty'), - CONVERSATION_STARTED: this.$t('chat.conversationStarted'), - TYPE_MESSAGE: this.$t('chat.typeMessage'), - SEARCH: this.$t('chat.search'), - IS_ONLINE: this.$t('chat.isOnline'), - LAST_SEEN: this.$t('chat.lastSeen'), - IS_TYPING: this.$t('chat.isTyping'), - CANCEL_SELECT_MESSAGE: this.$t('chat.cancelSelectMessage'), - }, roomActions: [ /* { @@ -190,6 +176,22 @@ export default { computedChatStyle() { return chatStyle.STYLE.light }, + textMessages() { + return { + ROOMS_EMPTY: this.$t('chat.roomsEmpty'), + ROOM_EMPTY: this.$t('chat.roomEmpty'), + NEW_MESSAGES: this.$t('chat.newMessages'), + MESSAGE_DELETED: this.$t('chat.messageDeleted'), + MESSAGES_EMPTY: this.$t('chat.messagesEmpty'), + CONVERSATION_STARTED: this.$t('chat.conversationStarted'), + TYPE_MESSAGE: this.$t('chat.typeMessage'), + SEARCH: this.$t('chat.search'), + IS_ONLINE: this.$t('chat.isOnline'), + LAST_SEEN: this.$t('chat.lastSeen'), + IS_TYPING: this.$t('chat.isTyping'), + CANCEL_SELECT_MESSAGE: this.$t('chat.cancelSelectMessage'), + } + }, }, methods: { async fetchRooms({ room } = {}) { diff --git a/webapp/graphql/Messages.js b/webapp/graphql/Messages.js index 1d7917bfc..26b9b516f 100644 --- a/webapp/graphql/Messages.js +++ b/webapp/graphql/Messages.js @@ -3,7 +3,7 @@ import gql from 'graphql-tag' export const messageQuery = () => { return gql` query ($roomId: ID!, $first: Int, $offset: Int) { - Message(roomId: $roomId, first: $first, offset: $offset, orderBy: createdAt_desc) { + Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) { _id id indexId