Skip to content

Commit

Permalink
fix: Notifications channel
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Nov 18, 2024
1 parent 1e6f42e commit 15ffea9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/navigation/notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function Notifications() {
})

echo
.private(`App.User.${JSON.parse(currentUser).user.id}`)
.private(`App.Models.User.${JSON.parse(currentUser).user.id}`)
.notification((notification: INotification) => {
setNotifications([notification, ...tempNotifications])

Expand All @@ -108,7 +108,7 @@ export default function Notifications() {
})

return () => {
echo.leave(`App.User.${JSON.parse(currentUser).user.id}`)
echo.leave(`App.Models.User.${JSON.parse(currentUser).user.id}`)
echo.disconnect()
}
}, [])
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/notificationcreator.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ToastProvider } from "@radix-ui/react-toast"
import { useTranslation } from "react-i18next"

import { INotification } from "@/types/notification"
import {
Notification,
NotificationClose,
NotificationViewport,
} from "@/components/ui/notification"
import { INotification } from "@/types/notification"

import StatusBadge, { Status } from "./status-badge"
import { useNotification } from "./use-notification"
Expand All @@ -17,7 +17,7 @@ export function NotificationCreator() {

return (
<ToastProvider>
{toasts.map(function (props: INotification) {
{Array.from(new Map(toasts.map(toast => [toast.notification_id, toast])).values()).map(function (props: INotification) {
return (
<Notification key={props.notification_id}>
<div className="relative flex w-full flex-col gap-1">
Expand Down

0 comments on commit 15ffea9

Please sign in to comment.