diff --git a/src/client/webapp/elements/require/atoms-funcs.ts b/src/client/webapp/elements/require/atoms-funcs.ts index 02a71cf..dd56db9 100644 --- a/src/client/webapp/elements/require/atoms-funcs.ts +++ b/src/client/webapp/elements/require/atoms-funcs.ts @@ -27,7 +27,7 @@ import { LoadedScrollingEnd, LoadedValueScrolling, } from './loadables'; -import { guildState } from './atoms'; +import { guildsManagerState, guildState } from './atoms'; import { Changes } from '../../data-types'; import { randomUUID } from 'crypto'; @@ -51,6 +51,8 @@ export function createFetchValueFunc( LOG.debug(`${fvfId} awaiting getPromise(guildState(${guildId}))`); const guild = await getPromise(guildState(guildId)); LOG.debug(`${fvfId} got guild from gm for g#${guildId}: ${guild}`); + const guildsManager = await getPromise(guildsManagerState); + LOG.debug(`${fvfId} got gm - ${guildsManager?.guilds.length} guilds, ${guildsManager}`); if (guild === null) return; // NOTE: This would only happen if this atom is created before its corresponding guild exists in the guildsManager const selfState = await getPromise(node); diff --git a/src/client/webapp/elements/require/atoms.ts b/src/client/webapp/elements/require/atoms.ts index 7e30626..39a6010 100644 --- a/src/client/webapp/elements/require/atoms.ts +++ b/src/client/webapp/elements/require/atoms.ts @@ -554,6 +554,7 @@ export function useInitRecoil(guildsManager: GuildsManager) { const setGuilds = useSetRecoilState(allGuildsState); const [currGuildId, setCurrGuildId] = useRecoilState(currGuildIdState); useEffect(() => { + LOG.debug(`setting guildsManager to ${guildsManager?.guilds.length}`); setGuildsManager(guildsManager); }, [guildsManager, setGuildsManager]); useEffect(() => {