Fixed sidebar users
This commit is contained in:
@@ -64,7 +64,11 @@ export default function AppSidebar({
|
|||||||
const [userList, setUserList] = useState<StringMap<UserProfile>>({});
|
const [userList, setUserList] = useState<StringMap<UserProfile>>({});
|
||||||
|
|
||||||
const dms = Array.from(
|
const dms = Array.from(
|
||||||
new Set(messages?.flatMap((item) => [item.from, item.channel_id]) || [])
|
new Set(
|
||||||
|
messages
|
||||||
|
?.flatMap((item) => [item.from, item.channel_id])
|
||||||
|
.filter((item) => item !== user?.id) || []
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -280,12 +284,10 @@ function DMItem({
|
|||||||
status: string;
|
status: string;
|
||||||
settings?: boolean;
|
settings?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={`/chat/${id}`}
|
href={settings ? "" : `/chat/${id}`}
|
||||||
className="p-2 flex flex-row items-center gap-2 cursor-pointer hover:bg-accent"
|
className="p-2 flex flex-row items-center gap-2 cursor-pointer hover:bg-accent rounded-md"
|
||||||
>
|
>
|
||||||
<ProfilePicture name={name} url={avatar} />
|
<ProfilePicture name={name} url={avatar} />
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
|
|||||||
Reference in New Issue
Block a user