recoil debugging logs

This commit is contained in:
Michael Peters 2022-10-22 11:35:32 -07:00
parent d74423b02f
commit 8a5990a69a
2 changed files with 4 additions and 1 deletions

View File

@ -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<T>(
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);

View File

@ -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(() => {