Merge branch 'dev'

This commit is contained in:
Jeff Emmett 2026-03-25 16:42:59 -07:00
commit 498f38ed02
2 changed files with 3 additions and 2 deletions

View File

@ -3451,10 +3451,10 @@ const server = Bun.serve<WSData>({
} }
} else if (msg.type === "ping") { } else if (msg.type === "ping") {
ws.send(JSON.stringify({ type: "pong", timestamp: msg.timestamp })); ws.send(JSON.stringify({ type: "pong", timestamp: msg.timestamp }));
} else if (msg.type === "presence") { } else if (msg.type === "presence" || msg.type === "presence-leave") {
const clients = communityClients.get(communitySlug); const clients = communityClients.get(communitySlug);
if (clients) { if (clients) {
const presenceMsg = JSON.stringify({ type: "presence", peerId, ...msg }); const presenceMsg = JSON.stringify({ ...msg, peerId });
for (const [clientPeerId, client] of clients) { for (const [clientPeerId, client] of clients) {
if (clientPeerId !== peerId && client.readyState === WebSocket.OPEN) { if (clientPeerId !== peerId && client.readyState === WebSocket.OPEN) {
client.send(presenceMsg); client.send(presenceMsg);

View File

@ -106,6 +106,7 @@ export class RStackCollabOverlay extends HTMLElement {
window.removeEventListener('rspace-doc-subscribe', this.#onDocSubscribe); window.removeEventListener('rspace-doc-subscribe', this.#onDocSubscribe);
this.#unsubAwareness?.(); this.#unsubAwareness?.();
this.#unsubPresence?.(); this.#unsubPresence?.();
this.#unsubLeave?.();
this.#stopMouseTracking(); this.#stopMouseTracking();
this.#stopFocusTracking(); this.#stopFocusTracking();
} }