From 544c782e8404d2d0a8f884a2c8d546e44f9b8c5c Mon Sep 17 00:00:00 2001 From: Giovanni-Josserand Date: Thu, 19 Mar 2026 10:04:58 +0100 Subject: [PATCH] fix broadcast name --- src/components/Header/Header.tsx | 4 ++-- .../{userCreatedListener.js => adminNotificationsListener.js} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/utils/echo/listeners/{userCreatedListener.js => adminNotificationsListener.js} (78%) diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index ea8bf8c..a7188b9 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -5,7 +5,7 @@ import getUserNotifications from "../../utils/notifications/getUserNotifications import deleteNotificationUser from "../../utils/notifications/deleteNotificationUser.js"; import initEcho from "../../utils/echo/initEcho.js" import readNotifications from "../../utils/notifications/readNotifications.js"; -import { userCreatedListener } from "../../utils/echo/listeners/userCreatedListener"; +import { adminNotificationsListener } from "../../utils/echo/listeners/adminNotificationsListener"; import { userNotificationsListener } from "../../utils/echo/listeners/userNotificationsListener.js"; import NotificationCard from "../NotificationCard/NotificationCard"; import { EventContext } from "../../contexts/Events/EventContext.js"; @@ -44,7 +44,7 @@ function Header() { echoInstance = echo; const activeChannels: (string | null)[] = [ - userCreatedListener(echo, user, setNotifications, setunreadNotification, updatePendingMembers), + adminNotificationsListener(echo, user, setNotifications, setunreadNotification, updatePendingMembers), userNotificationsListener(echo, user, setNotifications, setunreadNotification), ]; channelsToLeave = activeChannels.filter((name): name is string => name !== null); diff --git a/src/utils/echo/listeners/userCreatedListener.js b/src/utils/echo/listeners/adminNotificationsListener.js similarity index 78% rename from src/utils/echo/listeners/userCreatedListener.js rename to src/utils/echo/listeners/adminNotificationsListener.js index a4a36c4..d9cc07c 100644 --- a/src/utils/echo/listeners/userCreatedListener.js +++ b/src/utils/echo/listeners/adminNotificationsListener.js @@ -1,6 +1,6 @@ -export const userCreatedListener = (echo, userData, setNotifications, setunreadNotification, updatePendingMembers) => { +export const adminNotificationsListener = (echo, userData, setNotifications, setunreadNotification, updatePendingMembers) => { if (userData.isAdmin) { - const channelName = "users.registration"; + const channelName = "users.admin"; echo.private(channelName) .listen(".users.registration", (event) => { const newNotification = {