Skip to content

Commit

Permalink
This ensures that the current user is shown correc
Browse files Browse the repository at this point in the history
-tly based on the configuration settings.
  • Loading branch information
CowboySticky committed Jul 28, 2024
1 parent 7db0e5c commit f772b15
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/desktop/src/views/channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ export const ChannelView = ({ alignDirection }: { alignDirection: DirectionLR })
const allUsers = Object.entries(users);
let userList = showOnlyTalkingUsers ? allUsers.filter(([, item]) => item.talking) : allUsers;

if (!showOwnUser) {
userList = userList.filter(([, item]) => item.id !== me?.id);
}
userList = userList.filter(([, item]) => {
if (item.id === me?.id) {
return showOwnUser && (showOnlyTalkingUsers ? item.talking : true);
}
return true;
});

return (
<div>
<div className={`py-2 ${alignDirection == "center" ? "flex flex-wrap justify-center" : ""}`}>
<div className={`py-2 ${alignDirection === "center" ? "flex flex-wrap justify-center" : ""}`}>
{userList.map(([, item]) => (
<User key={item.id} item={item} alignDirection={alignDirection} />
))}
Expand Down

0 comments on commit f772b15

Please sign in to comment.