File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import Step from "@/components/Step";
1313import { MainContainer } from "@/components/styles" ;
1414import CenteredImage from "@/components/CenteredImage" ;
1515import noModelImage from "@/assets/no-model-light.svg" ;
16- import { useNavigate , useParams } from "react-router-dom" ;
16+ import { useNavigate , useParams , useNavigationType } from "react-router-dom" ;
1717import DownloadButton from "@/components/DownloadButton" ;
1818import { convertSimulationQueriesResultToTabulatedData , convertTabulatedDataToCSVFormat } from "@/functions/Formatting" ;
1919
@@ -22,6 +22,14 @@ const Models: React.FC = () => {
2222 const { models } = useAvailableModels ( ) ;
2323 const { simulationId } = useParams < { simulationId ?: string } > ( ) ;
2424 const navigate = useNavigate ( ) ;
25+ const navigationType = useNavigationType ( ) ;
26+
27+ useEffect ( ( ) => {
28+ if ( navigationType === "POP" && simulationId && sessionStorage . getItem ( "lastReloadId" ) !== simulationId ) {
29+ sessionStorage . setItem ( "lastReloadId" , simulationId ) ;
30+ window . location . reload ( ) ;
31+ }
32+ } , [ simulationId , navigationType ] ) ;
2533
2634 const { mutate : setModelInput } = useMutation ( {
2735 mutationFn : startSimulation ,
You can’t perform that action at this time.
0 commit comments