mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-19 20:46:11 +02:00
remove websocket init for now, fix lint
This commit is contained in:
parent
77f89b7314
commit
1602afdd3e
|
@ -21,20 +21,11 @@ document.body.addEventListener('htmx:responseError', (e) => {
|
|||
showErrorToast(`Error ${e.detail.xhr.status} when calling ${e.detail.requestConfig.path}`);
|
||||
});
|
||||
|
||||
let webSocket;
|
||||
|
||||
// TODO: move websocket creation to shared webworker
|
||||
htmx.createWebSocket = (url) => {
|
||||
if (![0, 1].includes(webSocket?.readyState)) return webSocket;
|
||||
const ws = new WebSocket(url, []);
|
||||
ws.binaryType = htmx.config.wsBinaryType;
|
||||
webSocket = ws;
|
||||
return ws;
|
||||
};
|
||||
// TODO: move websocket creation to shared webworker by overriding htmx.createWebSocket
|
||||
|
||||
document.body.addEventListener('htmx:wsOpen', (e) => {
|
||||
const socket = e.detail.socketWrapper;
|
||||
socket.send(
|
||||
JSON.stringify({ action: 'subscribe', data: { url: window.location.href } })
|
||||
JSON.stringify({action: 'subscribe', data: {url: window.location.href}})
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue