l-min-components 1.7.1294 → 1.7.1295

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.7.1294",
3
+ "version": "1.7.1295",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -133,8 +133,7 @@ const AppMainLayout = ({ children }) => {
133
133
  user,
134
134
  userDetails,
135
135
  } = useHeader({ default: true });
136
- // get current default account and store in cookie (from api)
137
-
136
+ // get current default account and store in cookie (from api);
138
137
  useEffect(() => {
139
138
  if (getDefaultAccount?.data) {
140
139
  const date = new Date();
@@ -98,7 +98,6 @@ const InstructorAccountSwitcher = ({ generalData, onChange }) => {
98
98
  };
99
99
 
100
100
  const { accountName, planState } = useContext(OutletContext);
101
-
102
101
  // handle if account does not have subscription but is an affiliate
103
102
  const prioritizedAffiliateId = useMemo(() => {
104
103
  let prioritizedAffiliateId = null;
@@ -112,6 +111,7 @@ const InstructorAccountSwitcher = ({ generalData, onChange }) => {
112
111
  ) {
113
112
  // Priority 2: If no cookie, no subscription, and list exists...
114
113
  // Assign the ID of the *first* affiliate directly from the results array
114
+ setCookie(getAllAffiliateData.data.results[0]?.id);
115
115
  prioritizedAffiliateId = getAllAffiliateData.data.results[0]?.id; // Optional chaining on 'id'
116
116
  }
117
117
  return prioritizedAffiliateId;
@@ -240,7 +240,7 @@ const InstructorAccountSwitcher = ({ generalData, onChange }) => {
240
240
  </div>
241
241
  {
242
242
  <div className="btn__wrapper">
243
- {!!!prioritizedAffiliateId && (
243
+ {(planState === "ACTIVE" || planState === "GRACE PERIOD") && (
244
244
  <button
245
245
  className={switchValue !== "affiliates" ? "active" : ""}
246
246
  onClick={() => handleSwitch(1)}>