l-min-components 1.0.187 → 1.0.191

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.187",
3
+ "version": "1.0.191",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -29,7 +29,7 @@ const AccountDropdown = (props) => {
29
29
  if (pathname?.includes("personal")) {
30
30
  setSelectedAccount(personalAccountData[0]);
31
31
  }
32
- if (pathname?.includes("developer")) {
32
+ if (window.location.host?.includes("developer")) {
33
33
  setSelectedAccount(developerAccountData[0]);
34
34
  }
35
35
  if (pathname?.includes("instructor")) {
@@ -78,8 +78,16 @@ const AccountDropdown = (props) => {
78
78
  }
79
79
  }, [props?.data?.data]);
80
80
  useEffect(() => {
81
- if (selectedAccount) {
82
- window.localStorage.setItem("current-account", selectedAccount);
81
+ if (selectedAccount?.type === "DEVELOPER") {
82
+ date.setDate(date.getDate() + 28);
83
+ document.cookie =
84
+ "activeDeveloperAccount=" +
85
+ selectedAccount?.id +
86
+ `; domain=${
87
+ window.location.href.includes("localhost")
88
+ ? ".localhost"
89
+ : ".learngual.com"
90
+ }; path=/; expires=${date.toUTCString()};`;
83
91
  }
84
92
  }, [selectedAccount]);
85
93
  return (
@@ -146,10 +154,17 @@ const AccountDropdown = (props) => {
146
154
  className="account-info"
147
155
  onClick={() => {
148
156
  setSelectedAccount(developerItem);
149
- if (window.location.port) {
150
- window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/developer`;
151
- } else {
152
- window.location.href = `${window.location.protocol}//${window.location.hostname}/developer`;
157
+
158
+ if (
159
+ window.location.port &&
160
+ window.location.host.includes("developer")
161
+ ) {
162
+ window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/`;
163
+ } else if (
164
+ !window.location.port &&
165
+ window.location.host.includes("developer")
166
+ ) {
167
+ window.location.href = `${window.location.protocol}//${window.location.hostname}/`;
153
168
  }
154
169
  }}
155
170
  key={idx}