mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-25 23:22:06 -05:00
fix(sidebar): use autorun instead of reaction
This commit is contained in:
parent
b745cdd4d7
commit
00764b8cc3
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable react-hooks/rules-of-hooks */
|
||||
import { reaction } from "mobx";
|
||||
import { autorun, reaction } from "mobx";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Role } from "revolt-api/types/Servers";
|
||||
|
@ -170,7 +170,7 @@ function useEntries(
|
|||
export const GroupMemberSidebar = observer(
|
||||
({ channel }: { channel: Channel }) => {
|
||||
const entries = useEntries(channel, (effect) =>
|
||||
reaction(() => channel.recipient_ids!, effect),
|
||||
autorun(() => effect(channel.recipient_ids!)),
|
||||
);
|
||||
|
||||
return (
|
||||
|
@ -209,7 +209,7 @@ export const ServerMemberSidebar = observer(
|
|||
|
||||
const entries = useEntries(
|
||||
channel,
|
||||
(effect) => reaction(() => [...client.members.keys()], effect),
|
||||
(effect) => autorun(() => effect([...client.members.keys()])),
|
||||
true,
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue