akeyless-client-commons 1.1.17-test.6 → 1.1.17-test.7
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/hooks/index.js +6 -3
- package/dist/hooks/index.mjs +6 -3
- package/package.json +1 -1
package/dist/hooks/index.js
CHANGED
|
@@ -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
|
-
|
|
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() {
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -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
|
-
|
|
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() {
|