Skip to content

Commit 922dabd

Browse files
committed
fix: Typing
1 parent ef550c1 commit 922dabd

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

app/src/components/Layout.tsx

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
import { useEffect, useRef } from 'react';
2-
import { useDispatch, useSelector } from 'react-redux';
32
import { Outlet, useLocation } from 'react-router-dom';
43
import { AppShell } from '@mantine/core';
54
import { spacing } from '@/designTokens';
6-
import { useIngredientReset } from '@/hooks/useIngredientReset';
7-
import { clearFlow } from '@/reducers/flowReducer';
8-
import { RootState } from '@/store';
95
import { cacheMonitor } from '@/utils/cacheMonitor';
106
import HeaderNavigation from './shared/HomeHeader';
117
import LegacyBanner from './shared/LegacyBanner';
128
import Sidebar from './Sidebar';
139

1410
export default function Layout() {
15-
const dispatch = useDispatch();
16-
const { currentFrame, currentFlow } = useSelector((state: RootState) => state.flow);
17-
const { resetIngredient } = useIngredientReset();
1811
const location = useLocation();
1912
const previousLocation = useRef(location.pathname);
2013

21-
// Log navigation events for cache monitoring and handle flow clearing
14+
// Log navigation events for cache monitoring
2215
useEffect(() => {
2316
const from = previousLocation.current;
2417
const to = location.pathname;
@@ -27,34 +20,10 @@ export default function Layout() {
2720
console.log('[Layout] ========== NAVIGATION DETECTED ==========');
2821
console.log('[Layout] From:', from);
2922
console.log('[Layout] To:', to);
30-
console.log('[Layout] currentFlow:', currentFlow);
3123
cacheMonitor.logNavigation(from, to);
32-
33-
// Clear flow and all ingredients when navigating away from /create routes
34-
if (currentFlow && from.includes('/create') && !to.includes('/create')) {
35-
console.log('[Layout] Condition met: clearing flow and ingredients');
36-
console.log('[Layout] - currentFlow exists:', !!currentFlow);
37-
console.log('[Layout] - from.includes("/create"):', from.includes('/create'));
38-
console.log('[Layout] - !to.includes("/create"):', !to.includes('/create'));
39-
dispatch(clearFlow());
40-
console.log('[Layout] Dispatched clearFlow()');
41-
resetIngredient('report'); // Cascades to clear all ingredients
42-
console.log('[Layout] Called resetIngredient("report")');
43-
} else {
44-
console.log('[Layout] Condition NOT met - no clearing');
45-
console.log('[Layout] - currentFlow exists:', !!currentFlow);
46-
console.log('[Layout] - from.includes("/create"):', from.includes('/create'));
47-
console.log('[Layout] - !to.includes("/create"):', !to.includes('/create'));
48-
}
49-
5024
previousLocation.current = to;
5125
}
52-
}, [location.pathname, currentFlow, dispatch]);
53-
54-
// If PolicyParameterSelectorFrame is active, let it manage its own layout completely
55-
if (currentFrame === 'PolicyParameterSelectorFrame') {
56-
return <Outlet />;
57-
}
26+
}, [location.pathname]);
5827

5928
// Otherwise, render the normal layout with AppShell
6029
return (

0 commit comments

Comments
 (0)