permissions review

This commit is contained in:
2026-01-14 22:44:07 +01:00
parent 8aaf8e08a2
commit 9a0959e1cb
16 changed files with 131 additions and 41 deletions
+3 -7
View File
@@ -9,7 +9,6 @@ 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 getUser from "../../utils/getUser.js";
import { userCreatedListener } from "../../utils/echo/listeners/userCreatedListener";
import { userNotificationsListener } from "../../utils/echo/listeners/userNotificationsListener.js";
import NotificationCard from "../NotificationCard/NotificationCard.jsx";
@@ -28,10 +27,7 @@ function Header() {
async function initializeHeader() {
try {
const [userData, notifData] = await Promise.all([
getUser(),
getUserNotifications()
]);
const notifData = await getUserNotifications();
const data = notifData || [];
setNotifications(data);
@@ -42,8 +38,8 @@ function Header() {
echoInstance = echo;
const activeChannels = [
userCreatedListener(echo, userData, setNotifications, setunreadNotification),
userNotificationsListener(echo, userData, setNotifications, setunreadNotification),
userCreatedListener(echo, user, setNotifications, setunreadNotification),
userNotificationsListener(echo, user, setNotifications, setunreadNotification),
];
channelsToLeave = activeChannels.filter(name => name !== null);