We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab427e3 commit c4fc8d8Copy full SHA for c4fc8d8
server/src/database/chat.ts
@@ -119,12 +119,8 @@ export async function getOverview(
119
];
120
121
const sortedOverviewByTime = overview.sort((a, b) => {
122
- const dateA = a.lastMsg?.createdAt
123
- ? new Date(a.lastMsg.createdAt).getTime()
124
- : 0;
125
- const dateB = b.lastMsg?.createdAt
126
- ? new Date(b.lastMsg.createdAt).getTime()
127
+ const dateA = a.lastMsg?.createdAt ? a.lastMsg.createdAt.getTime() : 0;
+ const dateB = b.lastMsg?.createdAt ? b.lastMsg.createdAt.getTime() : 0;
128
return dateB - dateA;
129
});
130
0 commit comments