fix: oopsie

This commit is contained in:
ThaUnknown 2024-08-25 17:14:04 +02:00
parent d768b613a3
commit 581997444e
2 changed files with 3 additions and 3 deletions

View file

@ -82,7 +82,7 @@
<div class='font-size-20 font-weight-bold pl-5 pb-10'>
{Object.values($peers).length} Member(s)
</div>
{#each Object.values($peers) as user}
{#each Object.values($peers) as { user }}
<User {user} />
{/each}
{/if}

View file

@ -217,8 +217,7 @@ export class W2GClient extends EventEmitter {
/** @param {import('./events.js').default} event */
#sendToPeers (event) {
if (!this.#p2pt) return
for (const { peer } of Object.values(this.peers)) {
for (const { peer } of Object.values(this.peers.value)) {
if (peer) this.#sendEvent(peer, event)
}
}
@ -226,6 +225,7 @@ export class W2GClient extends EventEmitter {
destroy () {
debug('destroy')
this.#p2pt.destroy()
this.removeAllListeners()
this.#p2pt = null
this.isHost = false
this.peers.value = {}