fix broadcast name

This commit is contained in:
Giovanni committed 2026-03-19 10:04:58 +01:00
1 parent 39be6f25c6
commit 544c782e84
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ import getUserNotifications from "../../utils/notifications/getUserNotifications
import deleteNotificationUser from "../../utils/notifications/deleteNotificationUser.js"; import deleteNotificationUser from "../../utils/notifications/deleteNotificationUser.js";
import initEcho from "../../utils/echo/initEcho.js" import initEcho from "../../utils/echo/initEcho.js"
import readNotifications from "../../utils/notifications/readNotifications.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 { userNotificationsListener } from "../../utils/echo/listeners/userNotificationsListener.js";
import NotificationCard from "../NotificationCard/NotificationCard"; import NotificationCard from "../NotificationCard/NotificationCard";
import { EventContext } from "../../contexts/Events/EventContext.js"; import { EventContext } from "../../contexts/Events/EventContext.js";
@@ -44,7 +44,7 @@ function Header() {
echoInstance = echo; echoInstance = echo;
const activeChannels: (string | null)[] = [ const activeChannels: (string | null)[] = [
userCreatedListener(echo, user, setNotifications, setunreadNotification, updatePendingMembers), adminNotificationsListener(echo, user, setNotifications, setunreadNotification, updatePendingMembers),
userNotificationsListener(echo, user, setNotifications, setunreadNotification), userNotificationsListener(echo, user, setNotifications, setunreadNotification),
]; ];
channelsToLeave = activeChannels.filter((name): name is string => name !== null); channelsToLeave = activeChannels.filter((name): name is string => name !== null);
@@ -1,6 +1,6 @@
export const userCreatedListener = (echo, userData, setNotifications, setunreadNotification, updatePendingMembers) => { export const adminNotificationsListener = (echo, userData, setNotifications, setunreadNotification, updatePendingMembers) => {
if (userData.isAdmin) { if (userData.isAdmin) {
const channelName = "users.registration"; const channelName = "users.admin";
echo.private(channelName) echo.private(channelName)
.listen(".users.registration", (event) => { .listen(".users.registration", (event) => {
const newNotification = { const newNotification = {