fix: allow invite screen to properly load while signed out

This commit is contained in:
Paul
2021-12-25 20:43:54 +00:00
parent ef163cafa8
commit 3c106f5d29
4 changed files with 25 additions and 7 deletions

13
src/lib/FakeClient.tsx Normal file
View File

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