mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
fix: allow invite screen to properly load while signed out
This commit is contained in:
13
src/lib/FakeClient.tsx
Normal file
13
src/lib/FakeClient.tsx
Normal 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user