From e4041f9e41e90cb758d27b34d5d993a84004ebcb Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Sun, 9 Aug 2020 00:33:00 +0530 Subject: [PATCH] Updated websocket ts code ws factory now creates new object on each invocation instead of reusing --- src/main/frontend/chat/main.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/chat/main.ts b/src/main/frontend/chat/main.ts index 99dd265..72a5679 100644 --- a/src/main/frontend/chat/main.ts +++ b/src/main/frontend/chat/main.ts @@ -24,14 +24,12 @@ import { ActiveUserViewModel } from "./viewmodel/ActiveUserViewModel"; // log.setLevel("TRACE"); -const chatSocket = new SockJS("/chat"); const chatStompClient = new Client(); -chatStompClient.webSocketFactory = () => chatSocket; +chatStompClient.webSocketFactory = () => new SockJS("/chat"); chatStompClient.activate(); -const pingSocket = new SockJS("/ping"); const pingStompClient = new Client(); -pingStompClient.webSocketFactory = () => pingSocket; +pingStompClient.webSocketFactory = () => new SockJS("/ping"); pingStompClient.activate(); pingStompClient.onConnect = () => {