mirror of
https://github.com/go-gitea/gitea
synced 2024-10-20 04:19:50 +02:00
fix
This commit is contained in:
parent
85cf27e9cf
commit
abcc6094c5
@ -3,7 +3,10 @@ import 'idiomorph/dist/idiomorph-ext.js'; // https://github.com/bigskysoftware/i
|
||||
import 'htmx-ext-ws';
|
||||
import type {HtmxResponseInfo} from 'htmx.org';
|
||||
|
||||
type HtmxEvent = Event & {detail: HtmxResponseInfo};
|
||||
type SocketWrapper = {
|
||||
send: (msg: string) => void;
|
||||
};
|
||||
type HtmxEvent = Event & {detail: HtmxResponseInfo & {socketWrapper: SocketWrapper}};
|
||||
|
||||
// https://htmx.org/reference/#config
|
||||
window.htmx.config.requestClass = 'is-loading';
|
||||
@ -26,6 +29,6 @@ document.body.addEventListener('htmx:responseError', (event: HtmxEvent) => {
|
||||
document.body.addEventListener('htmx:wsOpen', (event: HtmxEvent) => {
|
||||
const socket = event.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
Block a user