l-min-components 1.0.225 → 1.0.230

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.225",
3
+ "version": "1.0.230",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -32,6 +32,19 @@ const AccountDropdown = (props) => {
32
32
  let developerArray = [];
33
33
  let instructorArray = [];
34
34
  let enterpriseArray = [];
35
+ const cookies = document.cookie;
36
+ const cookieArray = cookies.split(";");
37
+ let activeDeveloperAccount;
38
+ for (let i = 0; i < cookieArray.length; i++) {
39
+ const cookie = cookieArray[i].trim();
40
+ if (cookie.startsWith("activeDeveloperAccount=")) {
41
+ activeDeveloperAccount = cookie.substring(
42
+ "activeDeveloperAccount=".length,
43
+ cookie.length
44
+ );
45
+ break;
46
+ }
47
+ }
35
48
  props?.data?.data?.results?.map((accountItem, idx) => {
36
49
  if (
37
50
  accountItem?.type === "PERSONAL" &&
@@ -67,7 +80,10 @@ const AccountDropdown = (props) => {
67
80
  props?.setSelectedAccount(personalArray[0]);
68
81
  }
69
82
  if (window.location.host?.includes("developer")) {
70
- props?.setSelectedAccount(developerArray[0]);
83
+ props?.setSelectedAccount(
84
+ developerArray.find((item) => item.id === activeDeveloperAccount) ??
85
+ {}
86
+ );
71
87
  }
72
88
  if (pathname?.includes("instructor")) {
73
89
  props?.setSelectedAccount(instructorArray[0]);
@@ -143,7 +143,7 @@ const HeaderComponent = (props) => {
143
143
  <a
144
144
  onClick={() => {
145
145
  window.location.href =
146
- "https://developer-staging-01.learngual.com/settings/payment";
146
+ "https://developer-staging-01.learngual.com/settings/";
147
147
  }}
148
148
  >
149
149
  <SettingIcon /> Settings
@@ -43,14 +43,14 @@ const SideMenu = ({
43
43
  window.location.hostname.includes("staging") &&
44
44
  window.location.hostname.includes("developer")
45
45
  ) {
46
- window.location.href = `https://developer-staging-01.learngual.com/${path}`;
46
+ window.location.href = `https://developer-staging-01.learngual.com${path}`;
47
47
  } else if (window.location.hostname.includes("localhost")) {
48
48
  window.location.href = `http://localhost:${window.location.port}${path}`;
49
49
  } else if (
50
50
  window.location.hostname.includes("developer") &&
51
51
  !window.location.hostname.includes("staging")
52
52
  ) {
53
- window.location.href = `https://developer.learngual.com/${path}`;
53
+ window.location.href = `https://developer.learngual.com${path}`;
54
54
  }
55
55
  }}
56
56
  // to={route.path}