diff --git a/ts/sql/Server.node.ts b/ts/sql/Server.node.ts index 63eb7b408e..07c29983ef 100644 --- a/ts/sql/Server.node.ts +++ b/ts/sql/Server.node.ts @@ -323,7 +323,6 @@ const { omit, partition, pick, - sortBy, } = lodash; type ConversationRow = Readonly<{ @@ -5818,13 +5817,15 @@ function getSortedDocuments( type: 'contacts', }) as Array; - return sortBy( - (documents as Array).concat( - contacts - ), - [raw => raw.message.receivedAt, raw => raw.message.sentAt], - ['DESC', 'DESC'] - ).slice(0, options.limit); + return lodash + .orderBy( + (documents as Array).concat( + contacts + ), + [raw => raw.message.receivedAt, raw => raw.message.sentAt], + ['desc', 'desc'] + ) + .slice(0, options.limit); })(); }