1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-09 20:22:47 +01:00

handle possibly null activities in session sort

This commit is contained in:
Puyodead1 2023-12-05 16:52:30 -05:00
parent e54879e1fe
commit 9c8a80693d
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC

View File

@ -57,7 +57,7 @@ const getMostRelevantSession = (sessions: Session[]) => {
return (
statusMap[a.status] -
statusMap[b.status] +
(a.activities.length - b.activities.length) * 2
((a.activities?.length ?? 0) - (b.activities?.length ?? 0)) * 2
);
});