permissions review
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user