fix: Correction du Establishment context au refresh

This commit is contained in:
Luc SORIGNET
2025-05-01 12:19:07 +02:00
parent 31fdc612b1
commit 43e301ed64
9 changed files with 136 additions and 86 deletions

View File

@ -25,9 +25,8 @@ import Footer from '@/components/Footer';
export default function Layout({ children }) {
const router = useRouter(); // Définition de router
const [messages, setMessages] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [isPopupVisible, setIsPopupVisible] = useState(false);
const { profileRole, user } = useEstablishment();
const { profileRole, user, clearContext } = useEstablishment();
const softwareName = 'N3WT School';
const softwareVersion = `${process.env.NEXT_PUBLIC_APP_VERSION}`;
@ -38,6 +37,7 @@ export default function Layout({ children }) {
const confirmDisconnect = () => {
setIsPopupVisible(false);
disconnect();
clearContext();
};
const dropdownItems = [