|
|
|
@ -7,15 +7,15 @@ import UserInfo from './contextualBar/UserInfo'; |
|
|
|
|
import { useTab, useTabBarClose, useTabContext } from './providers/ToolboxProvider'; |
|
|
|
|
|
|
|
|
|
const getUid = (room, ownUserId) => { |
|
|
|
|
if (room.uids.length === 1) { |
|
|
|
|
if (room.uids?.length === 1) { |
|
|
|
|
return room.uids[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const uid = room.uids.filter((uid) => uid !== ownUserId).shift(); |
|
|
|
|
const uid = room.uids?.filter((uid) => uid !== ownUserId).shift(); |
|
|
|
|
|
|
|
|
|
// Self DMs used to be created with the userId duplicated.
|
|
|
|
|
// Sometimes rooms can have 2 equal uids, but it's a self DM.
|
|
|
|
|
return uid ?? room.uids[0]; |
|
|
|
|
return uid ? room.uids[0] : undefined; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const MemberListRouter = ({ rid }) => { |
|
|
|
|