This commit is contained in:
Charles Bochet 2024-12-12 19:17:58 +01:00
parent 3f9acacea7
commit b1e648a1ac
3 changed files with 2 additions and 23 deletions

View File

@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { useRecoilValue, useSetRecoilState } from 'recoil';
import { useRecoilValue } from 'recoil';
import {
setSessionId,
@ -8,14 +8,12 @@ import {
} from '@/analytics/hooks/useEventTracker';
import { useRequestFreshCaptchaToken } from '@/captcha/hooks/useRequestFreshCaptchaToken';
import { isCaptchaScriptLoadedState } from '@/captcha/states/isCaptchaScriptLoadedState';
import { isAppWaitingForFreshObjectMetadataState } from '@/object-metadata/states/isAppWaitingForFreshObjectMetadataState';
import { TableHotkeyScope } from '@/object-record/record-table/types/TableHotkeyScope';
import { AppBasePath } from '@/types/AppBasePath';
import { AppPath } from '@/types/AppPath';
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
import { SettingsPath } from '@/types/SettingsPath';
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
import { useDebouncedCallback } from 'use-debounce';
import { useCleanRecoilState } from '~/hooks/useCleanRecoilState';
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';
@ -52,27 +50,11 @@ export const PageChangeEffect = () => {
}
}, [location, previousLocation]);
const setIsAppWaitingForFreshObjectMetadata = useSetRecoilState(
isAppWaitingForFreshObjectMetadataState,
);
const setIsAppWaitingForFreshObjectMetadataDebounced = useDebouncedCallback(
() => {
setIsAppWaitingForFreshObjectMetadata(false);
},
100,
);
useEffect(() => {
if (isDefined(pageChangeEffectNavigateLocation)) {
navigate(pageChangeEffectNavigateLocation);
// setIsAppWaitingForFreshObjectMetadataDebounced();
}
}, [
navigate,
pageChangeEffectNavigateLocation,
setIsAppWaitingForFreshObjectMetadataDebounced,
]);
}, [navigate, pageChangeEffectNavigateLocation]);
useEffect(() => {
switch (true) {

View File

@ -11,8 +11,6 @@ export const ObjectMetadataItemsGater = ({
isAppWaitingForFreshObjectMetadataState,
);
console.log(isAppWaitingForFreshObjectMetadata);
const shouldDisplayChildren = !isAppWaitingForFreshObjectMetadata;
return (

View File

@ -11,7 +11,6 @@ export const ObjectMetadataItemsProvider = ({
children,
}: React.PropsWithChildren) => {
const objectMetadataItems = useRecoilValue(objectMetadataItemsState);
console.log('objectMetadataItems', objectMetadataItems);
const shouldDisplayChildren = objectMetadataItems.length > 0;