Re-work waiting for auth

This commit is contained in:
Jon Staab
2024-11-05 14:17:04 -08:00
parent ecb08cace9
commit 0ec2b6ec73
6 changed files with 50 additions and 47 deletions
+7
View File
@@ -63,9 +63,16 @@ export class Socket {
}
close = async () => {
if (this.cxn.url === 'wss://filter.nostr.wine/') {
console.trace('closing')
}
this.worker.pause()
this.ws?.close()
// Allow the socket to start closing before waiting
await sleep(100)
// Wait for the socket to fully clos
await this.wait()
this.ws = undefined