From 1d39da19f16a5789ecfca2d391376f90c79fbb20 Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Mon, 18 Sep 2023 11:40:45 -0700 Subject: [PATCH] Only reset auth status on successful auth --- src/ConnectionMeta.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ConnectionMeta.ts b/src/ConnectionMeta.ts index 03e76a1..ce53f31 100644 --- a/src/ConnectionMeta.ts +++ b/src/ConnectionMeta.ts @@ -102,10 +102,12 @@ export class ConnectionMeta { this.pendingPublishes.set(event.id, {sent: Date.now(), event}) } - onReceiveOk(eventId: string) { + onReceiveOk(eventId: string, ok: boolean) { const publish = this.pendingPublishes.get(eventId) - this.authStatus = AuthStatus.Ok + if (ok) { + this.authStatus = AuthStatus.Ok + } if (publish) { this.responseCount++