mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 08:30:58 -05:00
fix: finally fix the members sidebar (real)
This commit is contained in:
parent
00764b8cc3
commit
a09fbe685d
1 changed files with 5 additions and 7 deletions
|
@ -38,7 +38,7 @@ export default function MemberSidebar() {
|
|||
|
||||
function useEntries(
|
||||
channel: Channel,
|
||||
renderListener: (effect: (keys: string[]) => void) => () => void,
|
||||
generateKeys: () => string[],
|
||||
isServer?: boolean,
|
||||
) {
|
||||
const client = channel.client;
|
||||
|
@ -160,18 +160,16 @@ function useEntries(
|
|||
}
|
||||
|
||||
useEffect(() => {
|
||||
return renderListener(sort);
|
||||
return autorun(() => sort(generateKeys()));
|
||||
// eslint-disable-next-line
|
||||
}, [renderListener]);
|
||||
}, [generateKeys]);
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
||||
export const GroupMemberSidebar = observer(
|
||||
({ channel }: { channel: Channel }) => {
|
||||
const entries = useEntries(channel, (effect) =>
|
||||
autorun(() => effect(channel.recipient_ids!)),
|
||||
);
|
||||
const entries = useEntries(channel, () => channel.recipient_ids!);
|
||||
|
||||
return (
|
||||
<GenericSidebarBase data-scroll-offset="with-padding">
|
||||
|
@ -209,7 +207,7 @@ export const ServerMemberSidebar = observer(
|
|||
|
||||
const entries = useEntries(
|
||||
channel,
|
||||
(effect) => autorun(() => effect([...client.members.keys()])),
|
||||
() => [...client.members.keys()],
|
||||
true,
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue