Correction des redirections

This commit is contained in:
2026-06-17 22:45:08 +02:00
parent a8781a9f62
commit eb961cbed4
7 changed files with 80 additions and 26 deletions
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
import { useLocation, useNavigate } from 'react-router-dom';
import { api } from '../../api.js';
import { fmtDate } from '../../utils/format.js';
import { useInvestisseur } from '../../context/InvestisseurContext.jsx';
@@ -239,7 +239,7 @@ function DossierImport({
{' '}
<button
style={{ marginLeft: 8, fontSize: 'var(--fs-xs)', padding: '2px 8px' }}
onClick={() => navigate(`/investissements/${dossierResult.investissementId}`)}
onClick={() => navigate(`/investissements/${dossierResult.investissementId}`, { state: { from: { path: location.pathname, search: location.search, label: 'Imports' } } })}
>
Ouvrir le dossier →
</button>
@@ -253,6 +253,7 @@ function DossierImport({
export default function ImportsSection() {
const { activeId } = useInvestisseur();
const navigate = useNavigate();
const location = useLocation();
const [module, setModule] = useState('depots_retraits');
const [file, setFile] = useState(null);