fix: adds missing setLoading toggle

This commit is contained in:
Ben Kremer 2022-02-09 13:53:56 +01:00
parent 1ca7a5cfd1
commit 22c0a7c456

View File

@ -213,11 +213,14 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
const createClient = useCallback(async () => { const createClient = useCallback(async () => {
try { try {
setLoading(true);
const _client = await Client.init({ const _client = await Client.init({
logger: DEFAULT_LOGGER, logger: DEFAULT_LOGGER,
relayUrl: DEFAULT_RELAY_URL, relayUrl: DEFAULT_RELAY_URL,
projectId: DEFAULT_PROJECT_ID, projectId: DEFAULT_PROJECT_ID,
}); });
setClient(_client); setClient(_client);
await subscribeToEvents(_client); await subscribeToEvents(_client);
await checkPersistedState(_client); await checkPersistedState(_client);