🐛 Subscribe to socket event

This commit is contained in:
Rune Harlyk
2026-01-03 00:45:37 +01:00
committed by nikguin04
parent 61905f8e95
commit a9e38c845a
+1 -1
View File
@@ -215,9 +215,9 @@ function createWebSocket() {
let message_listeners_totag = message_listeners.get(tag) let message_listeners_totag = message_listeners.get(tag)
if (!message_listeners_totag) { if (!message_listeners_totag) {
// If this is the first listener to this event, also call subscribe to the server
message_listeners_totag = new Set() message_listeners_totag = new Set()
message_listeners.set(tag, message_listeners_totag) message_listeners.set(tag, message_listeners_totag)
subscribeToEvent(event_type)
} }
message_listeners_totag.add(listener as (data: unknown) => void) message_listeners_totag.add(listener as (data: unknown) => void)