Merge branch 'dev'
This commit is contained in:
commit
498f38ed02
|
|
@ -3451,10 +3451,10 @@ const server = Bun.serve<WSData>({
|
|||
}
|
||||
} else if (msg.type === "ping") {
|
||||
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);
|
||||
if (clients) {
|
||||
const presenceMsg = JSON.stringify({ type: "presence", peerId, ...msg });
|
||||
const presenceMsg = JSON.stringify({ ...msg, peerId });
|
||||
for (const [clientPeerId, client] of clients) {
|
||||
if (clientPeerId !== peerId && client.readyState === WebSocket.OPEN) {
|
||||
client.send(presenceMsg);
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ export class RStackCollabOverlay extends HTMLElement {
|
|||
window.removeEventListener('rspace-doc-subscribe', this.#onDocSubscribe);
|
||||
this.#unsubAwareness?.();
|
||||
this.#unsubPresence?.();
|
||||
this.#unsubLeave?.();
|
||||
this.#stopMouseTracking();
|
||||
this.#stopFocusTracking();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue