@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.cjs
CHANGED
|
@@ -758,7 +758,7 @@ var DatabaseLiveClient = class {
|
|
|
758
758
|
(refreshToken) => refreshAccessToken(this.baseUrl, refreshToken)
|
|
759
759
|
);
|
|
760
760
|
if (!token) throw new core.EdgeBaseError(401, "No access token available. Sign in first.");
|
|
761
|
-
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.
|
|
761
|
+
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.4" });
|
|
762
762
|
return new Promise((resolve, reject) => {
|
|
763
763
|
const timeout = setTimeout(() => reject(new core.EdgeBaseError(401, "Auth timeout")), 1e4);
|
|
764
764
|
const original = this.ws?.onmessage;
|
|
@@ -878,7 +878,7 @@ var DatabaseLiveClient = class {
|
|
|
878
878
|
refreshAuth() {
|
|
879
879
|
const token = this.tokenManager.currentAccessToken;
|
|
880
880
|
if (!token || !this.ws || !this.connected) return;
|
|
881
|
-
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.
|
|
881
|
+
this.sendRaw({ type: "auth", token, sdkVersion: "0.2.4" });
|
|
882
882
|
}
|
|
883
883
|
handleAuthStateChange(user) {
|
|
884
884
|
if (user) {
|
|
@@ -915,7 +915,7 @@ var DatabaseLiveClient = class {
|
|
|
915
915
|
}
|
|
916
916
|
handleAuthenticationFailure(error) {
|
|
917
917
|
const authError = error instanceof core.EdgeBaseError ? error : new core.EdgeBaseError(500, "Database live authentication failed.");
|
|
918
|
-
this.waitingForAuth = authError.code === 401 && this.connectedChannels.size > 0;
|
|
918
|
+
this.waitingForAuth = authError.code === 401 && this.connectedChannels.size > 0 && !this.hasAuthContext();
|
|
919
919
|
this.stopHeartbeat();
|
|
920
920
|
this.connected = false;
|
|
921
921
|
this.authenticated = false;
|