Default to created time if no chat activity

This commit is contained in:
Ian Philips 2022-07-18 07:38:02 -06:00
parent f393246e4f
commit a247e6d0de

View File

@ -68,10 +68,10 @@ export function listenForMemberGroups(
const q = query(groups, where('memberIds', 'array-contains', userId)) const q = query(groups, where('memberIds', 'array-contains', userId))
const sorter = (group: Group) => { const sorter = (group: Group) => {
if (sort?.by === 'mostRecentChatActivityTime') { if (sort?.by === 'mostRecentChatActivityTime') {
return group.mostRecentChatActivityTime ?? group.mostRecentActivityTime return group.mostRecentChatActivityTime ?? group.createdTime
} }
if (sort?.by === 'mostRecentContractAddedTime') { if (sort?.by === 'mostRecentContractAddedTime') {
return group.mostRecentContractAddedTime ?? group.mostRecentActivityTime return group.mostRecentContractAddedTime ?? group.createdTime
} }
return group.mostRecentActivityTime return group.mostRecentActivityTime
} }