Skip to content

Commit 1602afd

Browse files
committed
remove websocket init for now, fix lint
1 parent 77f89b7 commit 1602afd

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

web_src/js/htmx.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,11 @@ document.body.addEventListener('htmx:responseError', (e) => {
2121
showErrorToast(`Error ${e.detail.xhr.status} when calling ${e.detail.requestConfig.path}`);
2222
});
2323

24-
let webSocket;
25-
26-
// TODO: move websocket creation to shared webworker
27-
htmx.createWebSocket = (url) => {
28-
if (![0, 1].includes(webSocket?.readyState)) return webSocket;
29-
const ws = new WebSocket(url, []);
30-
ws.binaryType = htmx.config.wsBinaryType;
31-
webSocket = ws;
32-
return ws;
33-
};
24+
// TODO: move websocket creation to shared webworker by overriding htmx.createWebSocket
3425

3526
document.body.addEventListener('htmx:wsOpen', (e) => {
3627
const socket = e.detail.socketWrapper;
3728
socket.send(
38-
JSON.stringify({ action: 'subscribe', data: { url: window.location.href } })
29+
JSON.stringify({action: 'subscribe', data: {url: window.location.href}})
3930
);
4031
});

0 commit comments

Comments
 (0)