File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,19 @@ export const useParticipantIds = (
9292 case 'user_id' :
9393 case 'user_name' :
9494 sortFn = ( a , b ) => {
95- if ( a [ sort ] < b [ sort ] ) return - 1 ;
96- if ( a [ sort ] > b [ sort ] ) return 1 ;
95+ // joined_at can technically be undefined. so in that
96+ // case, sort whichever has a value first. though, it
97+ // should only be undefined in prejoin, when there are
98+ // no other participants to sort so... really this
99+ // shouldn't happen :)
100+ let aSort = a [ sort ] ;
101+ let bSort = b [ sort ] ;
102+ if ( aSort !== undefined || bSort !== undefined ) {
103+ if ( aSort === undefined ) return - 1 ;
104+ if ( bSort === undefined ) return 1 ;
105+ if ( aSort > bSort ) return 1 ;
106+ if ( aSort < bSort ) return - 1 ;
107+ }
97108 return 0 ;
98109 } ;
99110 break ;
You can’t perform that action at this time.
0 commit comments