(peer)
| 67 | } |
| 68 | }, |
| 69 | close(peer) { |
| 70 | const identity = peer.context.identity as Peer | undefined |
| 71 | if (!identity) return |
| 72 | peers.delete(identity.id) |
| 73 | peer.publish(CHANNEL, JSON.stringify({ t: 'leave', id: identity.id } satisfies ServerMessage)) |
| 74 | }, |
| 75 | error(peer, error) { |
| 76 | console.error('[realtime] ws error', peer.id, error) |
| 77 | const identity = peer.context.identity as Peer | undefined |