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
+1 -5
View File
@@ -39,17 +39,13 @@ export class Connection extends Emitter {
emit = (type: ConnectionEvent, ...args: any[]) => super.emit(type, this, ...args)
send = async (message: Message) => {
await this.open()
await this.socket.open()
if (this.status === Ready) {
this.sender.push(message)
}
}
open = async () => {
await this.socket.open()
}
close = async () => {
this.status = Closing