akeyless-client-commons 1.1.17-test.6 → 1.1.17-test.8

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.
@@ -1222,9 +1222,9 @@ var SocketService = /*#__PURE__*/ function() {
1222
1222
  this.socket.on("connect", function() {
1223
1223
  var _this_socket;
1224
1224
  console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
1225
- _this.connectCallbacks.forEach(function(cb) {
1226
- return cb();
1227
- });
1225
+ });
1226
+ this.connectCallbacks.forEach(function(cb) {
1227
+ return cb();
1228
1228
  });
1229
1229
  this.socket.on("disconnect", function(reason) {
1230
1230
  console.log("Socket disconnected:", reason);
@@ -1000,9 +1000,9 @@ var SocketService = /*#__PURE__*/ function() {
1000
1000
  this.socket.on("connect", function() {
1001
1001
  var _this_socket;
1002
1002
  console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
1003
- _this.connectCallbacks.forEach(function(cb) {
1004
- return cb();
1005
- });
1003
+ });
1004
+ this.connectCallbacks.forEach(function(cb) {
1005
+ return cb();
1006
1006
  });
1007
1007
  this.socket.on("disconnect", function(reason) {
1008
1008
  console.log("Socket disconnected:", reason);
@@ -2328,9 +2328,9 @@ var SocketService = /*#__PURE__*/ function() {
2328
2328
  this.socket.on("connect", function() {
2329
2329
  var _this_socket;
2330
2330
  console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
2331
- _this.connectCallbacks.forEach(function(cb) {
2332
- return cb();
2333
- });
2331
+ });
2332
+ this.connectCallbacks.forEach(function(cb) {
2333
+ return cb();
2334
2334
  });
2335
2335
  this.socket.on("disconnect", function(reason) {
2336
2336
  console.log("Socket disconnected:", reason);
@@ -1964,9 +1964,9 @@ var SocketService = /*#__PURE__*/ function() {
1964
1964
  this.socket.on("connect", function() {
1965
1965
  var _this_socket;
1966
1966
  console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
1967
- _this.connectCallbacks.forEach(function(cb) {
1968
- return cb();
1969
- });
1967
+ });
1968
+ this.connectCallbacks.forEach(function(cb) {
1969
+ return cb();
1970
1970
  });
1971
1971
  this.socket.on("disconnect", function(reason) {
1972
1972
  console.log("Socket disconnected:", reason);
@@ -673,9 +673,9 @@ var SocketService = /*#__PURE__*/ function() {
673
673
  this.socket.on("connect", function() {
674
674
  var _this_socket;
675
675
  console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
676
- _this.connectCallbacks.forEach(function(cb) {
677
- return cb();
678
- });
676
+ });
677
+ this.connectCallbacks.forEach(function(cb) {
678
+ return cb();
679
679
  });
680
680
  this.socket.on("disconnect", function(reason) {
681
681
  console.log("Socket disconnected:", reason);
@@ -968,6 +968,9 @@ var useSocketSubscription = function(configs, label, settings) {
968
968
  var _ref = _sliced_to_array((0, import_react3.useState)(socketServiceInstance.isConnected()), 2), socketConnected = _ref[0], setSocketConnected = _ref[1];
969
969
  var _ref1 = _sliced_to_array((0, import_react3.useState)([]), 2), cleanupSubscriptions = _ref1[0], setCleanupSubscriptions = _ref1[1];
970
970
  useDeepCompareEffect(function() {
971
+ if (!auth.currentUser) {
972
+ return;
973
+ }
971
974
  if (socketConnected) {
972
975
  setCleanupSubscriptions(function(prev) {
973
976
  return _to_consumable_array(prev).concat([
@@ -980,8 +983,7 @@ var useSocketSubscription = function(configs, label, settings) {
980
983
  }).join(", ")));
981
984
  }
982
985
  } else {
983
- var _auth_currentUser;
984
- auth === null || auth === void 0 ? void 0 : (_auth_currentUser = auth.currentUser) === null || _auth_currentUser === void 0 ? void 0 : _auth_currentUser.getIdToken().then(function(token) {
986
+ auth.currentUser.getIdToken().then(function(token) {
985
987
  socketServiceInstance.setAuthToken(token);
986
988
  socketServiceInstance.getSocketInstance();
987
989
  if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
@@ -1015,7 +1017,8 @@ var useSocketSubscription = function(configs, label, settings) {
1015
1017
  };
1016
1018
  }, [
1017
1019
  socketConnected,
1018
- configs
1020
+ configs,
1021
+ auth
1019
1022
  ]);
1020
1023
  (0, import_react3.useEffect)(function() {
1021
1024
  return function() {
@@ -579,9 +579,9 @@ var SocketService = /*#__PURE__*/ function() {
579
579
  this.socket.on("connect", function() {
580
580
  var _this_socket;
581
581
  console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
582
- _this.connectCallbacks.forEach(function(cb) {
583
- return cb();
584
- });
582
+ });
583
+ this.connectCallbacks.forEach(function(cb) {
584
+ return cb();
585
585
  });
586
586
  this.socket.on("disconnect", function(reason) {
587
587
  console.log("Socket disconnected:", reason);
@@ -874,6 +874,9 @@ var useSocketSubscription = function(configs, label, settings) {
874
874
  var _useState = _sliced_to_array(useState(socketServiceInstance.isConnected()), 2), socketConnected = _useState[0], setSocketConnected = _useState[1];
875
875
  var _useState1 = _sliced_to_array(useState([]), 2), cleanupSubscriptions = _useState1[0], setCleanupSubscriptions = _useState1[1];
876
876
  useDeepCompareEffect(function() {
877
+ if (!auth.currentUser) {
878
+ return;
879
+ }
877
880
  if (socketConnected) {
878
881
  setCleanupSubscriptions(function(prev) {
879
882
  return _to_consumable_array(prev).concat([
@@ -886,8 +889,7 @@ var useSocketSubscription = function(configs, label, settings) {
886
889
  }).join(", ")));
887
890
  }
888
891
  } else {
889
- var _auth_currentUser;
890
- auth === null || auth === void 0 ? void 0 : (_auth_currentUser = auth.currentUser) === null || _auth_currentUser === void 0 ? void 0 : _auth_currentUser.getIdToken().then(function(token) {
892
+ auth.currentUser.getIdToken().then(function(token) {
891
893
  socketServiceInstance.setAuthToken(token);
892
894
  socketServiceInstance.getSocketInstance();
893
895
  if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
@@ -921,7 +923,8 @@ var useSocketSubscription = function(configs, label, settings) {
921
923
  };
922
924
  }, [
923
925
  socketConnected,
924
- configs
926
+ configs,
927
+ auth
925
928
  ]);
926
929
  useEffect2(function() {
927
930
  return function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeyless-client-commons",
3
- "version": "1.1.17-test.6",
3
+ "version": "1.1.17-test.8",
4
4
  "scripts": {
5
5
  "build": "tsup",
6
6
  "deploy": "npm run build && npm version patch --no-git-tag-version && npm publish",