1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 03:33:33 +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
);
});