use pendingMembers context
This commit is contained in:
@@ -10,6 +10,7 @@ import { userNotificationsListener } from "../../utils/echo/listeners/userNotifi
|
||||
import NotificationCard from "../NotificationCard/NotificationCard.jsx";
|
||||
import { EventContext } from "../../contexts/events/EventContext.js";
|
||||
import {AuthContext} from "../../contexts/auth/AuthContext.js";
|
||||
import { PendingMembersContext } from "../../contexts/pendingMembers/PendingMembersContext";
|
||||
|
||||
function Header() {
|
||||
|
||||
@@ -20,6 +21,7 @@ function Header() {
|
||||
const [mobileMenu, setMobileMenu] = useState(false);
|
||||
const [notifications, setNotifications] = useState([]);
|
||||
const notificationRef = useRef(null);
|
||||
const { updatePendingMembers } = useContext(PendingMembersContext);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -41,7 +43,7 @@ function Header() {
|
||||
echoInstance = echo;
|
||||
|
||||
const activeChannels = [
|
||||
userCreatedListener(echo, user, setNotifications, setunreadNotification),
|
||||
userCreatedListener(echo, user, setNotifications, setunreadNotification, updatePendingMembers),
|
||||
userNotificationsListener(echo, user, setNotifications, setunreadNotification),
|
||||
];
|
||||
channelsToLeave = activeChannels.filter(name => name !== null);
|
||||
@@ -86,7 +88,7 @@ function Header() {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Erreur suppression notification :', err);
|
||||
console.error('Erreur pour ouvrir/fermer le menu de notifications :', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user