fix: Ordre des guardians lors de leur création / déselection correcte si

plusieurs guardians
This commit is contained in:
N3WT DE COMPET
2025-05-22 18:15:05 +02:00
parent eca8d7a8d5
commit 3b667d3b15
4 changed files with 83 additions and 18 deletions

View File

@ -8,14 +8,20 @@ export const NotificationProvider = ({ children }) => {
message: '',
type: '',
title: '',
errorCode: '',
});
const showNotification = (message, type = 'info', title = '') => {
setNotification({ message, type, title });
const showNotification = (
message,
type = 'info',
title = '',
errorCode = ''
) => {
setNotification({ message, type, title, errorCode });
};
const clearNotification = () => {
setNotification({ message: '', type: '', title: '' });
setNotification({ message: '', type: '', title: '', errorCode: '' });
};
return (
@ -25,6 +31,7 @@ export const NotificationProvider = ({ children }) => {
title={notification.title}
message={notification.message}
type={notification.type}
errorCode={notification.errorCode}
onClose={clearNotification}
/>
)}