From bac647d9140daf5fb4612e93645b1eeba102d349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Mon, 30 Sep 2024 10:45:26 +0300 Subject: [PATCH] feat: added json.parse --- src/components/App/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index 49d7b6881..a6d113f67 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -270,15 +270,17 @@ export const App = () => { ws.onmessage = (event) => { console.log('Message from server:', event.data) - if (event.data.type === 'ping') { + const data = JSON.parse(event.data) + + if (data.type === 'ping') { return } - SuccessNotify(event.data.message) + SuccessNotify(data.message) - setRunningProjectMessages(event.data.message) + setRunningProjectMessages(data.message) - console.log(event.data) + console.log(data) // Handle the message from the server here }