Skip to content

Commit

Permalink
fix(client): fixed error that delayed connection and threw disposed c…
Browse files Browse the repository at this point in the history
…onnectoin error
  • Loading branch information
st-vi committed Dec 12, 2023
1 parent 73c2492 commit 0289bad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WebSocketClient/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const createWebSocket = (url: string): WebSocket => {
createWebSocket(url);
}, 1000);
};
webSocket.onopen = async () => {
webSocket.onopen = () => {
if(connectionText){
displayEditorError("");
}
Expand All @@ -79,7 +79,8 @@ const createWebSocket = (url: string): WebSocket => {
reader,
writer
});
await languageClient.start();

languageClient.start();
reader.onClose(() => {
languageClient.stop();
createWebSocket(url);
Expand Down

0 comments on commit 0289bad

Please sign in to comment.