Wait for auth if status is unauthorized

This commit is contained in:
Jon Staab
2024-10-14 12:28:50 -07:00
parent cbf7aedfbf
commit c7816120b7
+1 -1
View File
@@ -130,7 +130,7 @@ export class Connection extends Emitter {
ensureAuth = async ({timeout = 3000} = {}) => {
await this.ensureConnected()
if (this.meta.authStatus === AuthStatus.Pending) {
if ([AuthStatus.Unauthorized, AuthStatus.Pending].includes(this.meta.authStatus)) {
await Promise.race([
sleep(timeout),
new Promise<void>(resolve => {