diff --git a/app/definitions/rest/v1/chat.ts b/app/definitions/rest/v1/chat.ts index 81d3ebe57..16f568756 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -38,7 +38,7 @@ export type ChatEndpoints = { 'chat.getThreadsList': { GET: (params: { rid: IServerRoom['_id']; - type: 'unread' | 'following' | 'all'; + type?: 'unread' | 'following' | 'all'; text?: string; offset: number; count: number; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 7e36b7b31..73502fc79 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -656,12 +656,11 @@ export const toggleFollowMessage = (mid: string, follow: boolean) => { }; export const getThreadsList = ({ rid, count, offset, text }: { rid: string; count: number; offset: number; text?: string }) => { - const params: any = { + const params = { rid, count, - offset, - sort: { ts: -1 } - }; + offset + } as { rid: string; count: number; offset: number; text?: string }; if (text) { params.text = text; } diff --git a/app/views/ThreadMessagesView/index.tsx b/app/views/ThreadMessagesView/index.tsx index cf40dab82..5d17729df 100644 --- a/app/views/ThreadMessagesView/index.tsx +++ b/app/views/ThreadMessagesView/index.tsx @@ -335,7 +335,7 @@ class ThreadMessagesView extends React.Component