jett.admin.npmpackage 2.0.27 → 2.0.29
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.js +6 -5
- package/dist/index.mjs +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -914,9 +914,11 @@ var SwitchProfileSection = ({
|
|
|
914
914
|
const jettIdData = getJettIdCookieData();
|
|
915
915
|
const userName = (jettIdData == null ? void 0 : jettIdData.UserName) || "";
|
|
916
916
|
const userEmail = (jettIdData == null ? void 0 : jettIdData.UserEmail) || "";
|
|
917
|
-
const
|
|
917
|
+
const cookieProfileId = jettIdData == null ? void 0 : jettIdData.ProfileId;
|
|
918
918
|
const allMarkets = getProfilesFromJettIdCookie(true);
|
|
919
|
-
const markets = allMarkets.length ? allMarkets : (jettIdData == null ? void 0 : jettIdData.EntityName) ? [{ ProfileId:
|
|
919
|
+
const markets = allMarkets.length ? allMarkets : (jettIdData == null ? void 0 : jettIdData.EntityName) ? [{ ProfileId: cookieProfileId, EntityName: jettIdData.EntityName }] : [];
|
|
920
|
+
const tmcProfile = allMarkets.find((profile) => profile.Scope === "TMC");
|
|
921
|
+
const currentProfileId = tmcProfile ? tmcProfile.ProfileId : cookieProfileId;
|
|
920
922
|
const buildRequestContext = () => ({
|
|
921
923
|
UserAgent: typeof navigator !== "undefined" ? navigator.userAgent : "Mozilla/5.0",
|
|
922
924
|
TrackingId: crypto.randomUUID(),
|
|
@@ -993,11 +995,10 @@ var SwitchProfileSection = ({
|
|
|
993
995
|
(0, import_react13.useEffect)(() => {
|
|
994
996
|
if (!open || switchingProfileId) return;
|
|
995
997
|
if (allMarkets.length <= 1) return;
|
|
996
|
-
|
|
997
|
-
if (tmcProfile && tmcProfile.ProfileId !== currentProfileId) {
|
|
998
|
+
if (tmcProfile && tmcProfile.ProfileId !== cookieProfileId) {
|
|
998
999
|
handleProfileSwitch(tmcProfile);
|
|
999
1000
|
}
|
|
1000
|
-
}, [open, allMarkets,
|
|
1001
|
+
}, [open, allMarkets, cookieProfileId, tmcProfile, switchingProfileId]);
|
|
1001
1002
|
if (!open && !showLogoutConfirm || typeof document === "undefined") return null;
|
|
1002
1003
|
const handleConfirmLogout = () => {
|
|
1003
1004
|
setShowLogoutConfirm(false);
|
package/dist/index.mjs
CHANGED
|
@@ -880,9 +880,11 @@ var SwitchProfileSection = ({
|
|
|
880
880
|
const jettIdData = getJettIdCookieData();
|
|
881
881
|
const userName = (jettIdData == null ? void 0 : jettIdData.UserName) || "";
|
|
882
882
|
const userEmail = (jettIdData == null ? void 0 : jettIdData.UserEmail) || "";
|
|
883
|
-
const
|
|
883
|
+
const cookieProfileId = jettIdData == null ? void 0 : jettIdData.ProfileId;
|
|
884
884
|
const allMarkets = getProfilesFromJettIdCookie(true);
|
|
885
|
-
const markets = allMarkets.length ? allMarkets : (jettIdData == null ? void 0 : jettIdData.EntityName) ? [{ ProfileId:
|
|
885
|
+
const markets = allMarkets.length ? allMarkets : (jettIdData == null ? void 0 : jettIdData.EntityName) ? [{ ProfileId: cookieProfileId, EntityName: jettIdData.EntityName }] : [];
|
|
886
|
+
const tmcProfile = allMarkets.find((profile) => profile.Scope === "TMC");
|
|
887
|
+
const currentProfileId = tmcProfile ? tmcProfile.ProfileId : cookieProfileId;
|
|
886
888
|
const buildRequestContext = () => ({
|
|
887
889
|
UserAgent: typeof navigator !== "undefined" ? navigator.userAgent : "Mozilla/5.0",
|
|
888
890
|
TrackingId: crypto.randomUUID(),
|
|
@@ -959,11 +961,10 @@ var SwitchProfileSection = ({
|
|
|
959
961
|
useEffect(() => {
|
|
960
962
|
if (!open || switchingProfileId) return;
|
|
961
963
|
if (allMarkets.length <= 1) return;
|
|
962
|
-
|
|
963
|
-
if (tmcProfile && tmcProfile.ProfileId !== currentProfileId) {
|
|
964
|
+
if (tmcProfile && tmcProfile.ProfileId !== cookieProfileId) {
|
|
964
965
|
handleProfileSwitch(tmcProfile);
|
|
965
966
|
}
|
|
966
|
-
}, [open, allMarkets,
|
|
967
|
+
}, [open, allMarkets, cookieProfileId, tmcProfile, switchingProfileId]);
|
|
967
968
|
if (!open && !showLogoutConfirm || typeof document === "undefined") return null;
|
|
968
969
|
const handleConfirmLogout = () => {
|
|
969
970
|
setShowLogoutConfirm(false);
|