+1
-3
src/client/components/peer-list.tsx
+1
-3
src/client/components/peer-list.tsx
+2
-4
src/client/realm/connection.ts
+2
-4
src/client/realm/connection.ts
···
51
51
this.#nonces = new Map()
52
52
53
53
console.debug('realm connection starting!')
54
+
54
55
this.#socket = new WebSocket(this.#url)
55
56
this.#socket.onopen = this.#handleSocketOpen
56
57
this.#socket.onclose = this.#handleSocketClose
···
77
78
return this.#socket.readyState === this.#socket.OPEN
78
79
}
79
80
80
-
get peers(): Record<IdentID, PeerState> {
81
+
peerStates(): Record<IdentID, PeerState> {
81
82
const states: Record<IdentID, PeerState> = {}
82
83
for (const [identid, peer] of this.#peers) {
83
84
states[identid] = {
···
113
114
114
115
destroy() {
115
116
console.debug('realm connection destroy!')
116
-
117
-
// disconnect from socket
118
117
if (this.connected) {
119
118
this.#socket.close()
120
119
}
···
158
157
159
158
// handle socket open is the main loop for the sendSocket
160
159
#handleSocketOpen: WebSocket['onopen'] = async () => {
161
-
console.debug('realm connection, socket loop open')
162
160
this.#dispatchCustomEvent('wsopen')
163
161
164
162
try {