fix(invite): allow logged out users to view invites

This commit is contained in:
Paul Makles
2021-12-28 12:24:35 +00:00
parent 729716b22f
commit a9501ded91
4 changed files with 19 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
import { observer } from "mobx-react-lite";
import { useMemo } from "preact/hooks";
import { useApplicationState } from "../mobx/State";
@@ -6,8 +8,8 @@ import { AppContext } from "../context/revoltjs/RevoltClient";
import { Children } from "../types/Preact";
export default function FakeClient({ children }: { children: Children }) {
export default observer(({ children }: { children: Children }) => {
const config = useApplicationState().config;
const client = useMemo(() => config.createClient(), []);
const client = useMemo(() => config.createClient(), [config.get()]);
return <AppContext.Provider value={client}>{children}</AppContext.Provider>;
}
});