From 54f114c8c90163f4fcccee72243ae3e43c22bb17 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 18 Oct 2023 13:48:50 +0300 Subject: [PATCH] event-stream-debug --- src/context/notifications.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context/notifications.tsx b/src/context/notifications.tsx index 31be3491..37e7c42a 100644 --- a/src/context/notifications.tsx +++ b/src/context/notifications.tsx @@ -95,14 +95,14 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => { loadNotifications() const token = getToken() - const eventSource = new EventSource(`https://chat.discours.io/connect/${token}`) + const eventSource = new EventSource(`https://chat.discours.io/connect/?token=${token}`) eventSource.onmessage = (event) => { const n: { kind: string; payload: any } = JSON.parse(event.data) + console.log('[context.notifications] Received notification:', n) if (n.kind === 'new_message') { messageHandler()(n.payload) } else { - console.log('[context.notifications] Received notification:', n) storeNotification({ kind: n.kind, payload: n.payload,