diff --git a/src/app/page.tsx b/src/app/page.tsx index 12ef42f..33023be 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -6,6 +6,7 @@ import { Button, Select } from 'antd'; import type { TableRowSelection } from 'antd/es/table/interface'; import { useRouter } from 'next/navigation'; import React, { useEffect, useState } from 'react'; +import { useDispatch } from 'react-redux'; import AppLayout from '@/components/custom/AppLayout/AppLayout'; import EditableTable from '@/components/custom/EditableTable/EditableTable'; @@ -14,6 +15,7 @@ import { StandardText } from '@/components/custom/StandardText/StandardText'; import { VBox } from '@/components/custom/VBox/VBox'; import { useScenarioGroups } from '@/hooks/useScenarioGroups'; import { useFetchFeedQuery, usePatchModelMutation } from '@/store'; +import { clearModel } from '@/store/slices/modelSlice'; import type { PlotModel } from '@/types/feed/Feed'; import { COLUMNS } from '../utils/constants'; @@ -26,6 +28,7 @@ const Index = () => { ); const [selected, setSelected] = useState([]); const router = useRouter(); + const dispatch = useDispatch(); const { flowScenarios: flowScenarioOptions, @@ -39,6 +42,7 @@ const Index = () => { }, [data]); useEffect(() => { + dispatch(clearModel()); refetch(); }, []); diff --git a/src/components/custom/AppLayout/AppLayout.tsx b/src/components/custom/AppLayout/AppLayout.tsx index f114267..5f13f6a 100644 --- a/src/components/custom/AppLayout/AppLayout.tsx +++ b/src/components/custom/AppLayout/AppLayout.tsx @@ -12,7 +12,6 @@ import { useDispatch, useSelector } from 'react-redux'; import { BACKGROUND_COLOR, PRIMARY_COLOR } from '@/components/theme'; import { selectCurrentUser, setCredentials } from '@/store/slices/authSlice'; -import { clearModel } from '@/store/slices/modelSlice'; import ProfileButton from './ProfileButton'; @@ -26,11 +25,7 @@ const AppLayout = ({ children }: PropsWithChildren) => { const router = useRouter(); const titleRender = useCallback( (logo: ReactNode) => ( - dispatch(clearModel())} - > + {logo} ),