@edge-base/react-native 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -752,7 +752,7 @@ var DatabaseLiveClient = class {
|
|
|
752
752
|
(refreshToken) => refreshAccessToken(this.baseUrl, refreshToken)
|
|
753
753
|
);
|
|
754
754
|
if (!token) throw new EdgeBaseError(401, "No access token available. Sign in first.");
|
|
755
|
-
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.
|
|
755
|
+
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.4" });
|
|
756
756
|
return new Promise((resolve, reject) => {
|
|
757
757
|
const timeout = setTimeout(() => reject(new EdgeBaseError(401, "Auth timeout")), 1e4);
|
|
758
758
|
const original = this.ws?.onmessage;
|
|
@@ -872,7 +872,7 @@ var DatabaseLiveClient = class {
|
|
|
872
872
|
refreshAuth() {
|
|
873
873
|
const token = this.tokenManager.currentAccessToken;
|
|
874
874
|
if (!token || !this.ws || !this.connected) return;
|
|
875
|
-
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.
|
|
875
|
+
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.4" });
|
|
876
876
|
}
|
|
877
877
|
handleAuthStateChange(user) {
|
|
878
878
|
if (user) {
|
|
@@ -909,7 +909,7 @@ var DatabaseLiveClient = class {
|
|
|
909
909
|
}
|
|
910
910
|
handleAuthenticationFailure(error) {
|
|
911
911
|
const authError = error instanceof EdgeBaseError ? error : new EdgeBaseError(500, "Database live authentication failed.");
|
|
912
|
-
this.waitingForAuth = authError.code === 401 && this.connectedChannels.size > 0;
|
|
912
|
+
this.waitingForAuth = authError.code === 401 && this.connectedChannels.size > 0 && !this.hasAuthContext();
|
|
913
913
|
this.stopHeartbeat();
|
|
914
914
|
this.connected = false;
|
|
915
915
|
this.authenticated = false;
|