Fix iframe

pull/2529/head
Jérémy Rialland 2023-03-02 15:33:04 +01:00 committed by Johan Girod
parent 0300c817f7
commit 968f61239b
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import { Helmet } from 'react-helmet-async'
import { Route, Routes } from 'react-router-dom'
import { Route, Routes, useLocation } from 'react-router-dom'
import Route404 from '@/components/Route404'
import useSimulatorsData from '@/hooks/useSimulatorsData'
@ -26,7 +26,7 @@ export default function Iframes() {
s.iframePath && (
<Route
key={s.iframePath}
path={'/' + encodeURI(s.iframePath) + '/*'}
path={s.iframePath + '/*'}
element={
<>
<Helmet>

View File

@ -279,7 +279,10 @@ export function SimulateurCard({
'Lancer le simulateur'
)
}
to={{ pathname: (isIframe && iframePath) || path }}
to={{
pathname:
(isIframe && `/iframes/${encodeURI(iframePath ?? '')}`) || path,
}}
state={fromGérer ? { fromGérer: true } : { fromSimulateurs: true }}
role="link"
>