mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 15:10:57 -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 */
|
/* eslint-disable react-hooks/rules-of-hooks */
|
||||||
import { reaction } from "mobx";
|
import { autorun, reaction } from "mobx";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { Role } from "revolt-api/types/Servers";
|
import { Role } from "revolt-api/types/Servers";
|
||||||
|
@ -170,7 +170,7 @@ function useEntries(
|
||||||
export const GroupMemberSidebar = observer(
|
export const GroupMemberSidebar = observer(
|
||||||
({ channel }: { channel: Channel }) => {
|
({ channel }: { channel: Channel }) => {
|
||||||
const entries = useEntries(channel, (effect) =>
|
const entries = useEntries(channel, (effect) =>
|
||||||
reaction(() => channel.recipient_ids!, effect),
|
autorun(() => effect(channel.recipient_ids!)),
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -209,7 +209,7 @@ export const ServerMemberSidebar = observer(
|
||||||
|
|
||||||
const entries = useEntries(
|
const entries = useEntries(
|
||||||
channel,
|
channel,
|
||||||
(effect) => reaction(() => [...client.members.keys()], effect),
|
(effect) => autorun(() => effect([...client.members.keys()])),
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue