l-min-components 1.0.1036 → 1.0.1040

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.1036",
3
+ "version": "1.0.1040",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -68,10 +68,6 @@ const AppMainLayout = () => {
68
68
  handleGetUserPlan,
69
69
  getCurrentSubscriptionData,
70
70
  handleCurrentSubscription,
71
- handleGetDefaultAffiliate,
72
- handleGetAllAffiliate,
73
- getAllAffiliateData,
74
- getDefaultAffiliateData,
75
71
  } = useHeader();
76
72
 
77
73
  useEffect(() => {
@@ -303,8 +299,6 @@ const AppMainLayout = () => {
303
299
  !window.location.pathname.includes("manage-teams") && (
304
300
  <InstructorAccountSwitcher
305
301
  setAccountType={setAffiliatesActive}
306
- data={getAllAffiliateData?.data?.results}
307
- loading={getAllAffiliateData?.loading}
308
302
  generalData={generalData}
309
303
  onChange={(v) => setAffiliateAccount(v)}
310
304
  />
@@ -10,12 +10,7 @@ import OutsideAlerter from "../outsideEventChecker";
10
10
  import FullPageLoader from "../fullPageLoader";
11
11
  import deleteCookies from "./deleteCookies";
12
12
 
13
- const InstructorAccountSwitcher = ({
14
- setAccountType,
15
- data,
16
- generalData,
17
- onChange,
18
- }) => {
13
+ const InstructorAccountSwitcher = ({ generalData, onChange }) => {
19
14
  const [expiryFlow, setExpiryFlow] = useState();
20
15
  const [switchValue, setSwitchValue] = useState(null);
21
16
  const [selectedValue, setSelectedValue] = useState(null);
@@ -30,15 +25,13 @@ const InstructorAccountSwitcher = ({
30
25
  } = useHeader();
31
26
 
32
27
  useEffect(() => {
33
- if (getAllAffiliateData?.data?.count) {
34
- const account = generalData?.selectedAccount;
35
- if (account?.type?.toLocaleLowerCase() === "instructor") {
36
- handleGetAllAffiliate({ search });
37
- }
28
+ const account = generalData?.selectedAccount;
29
+ if (account?.type?.toLocaleLowerCase() === "instructor") {
30
+ handleGetAllAffiliate({ search });
38
31
  }
39
- }, [generalData?.selectedAccount, search, getAllAffiliateData?.data]);
32
+ }, [generalData?.selectedAccount, search]);
40
33
 
41
- const dropdownList = data?.map((item) => {
34
+ const dropdownList = getAllAffiliateData?.data?.results?.map((item) => {
42
35
  const image = item?.profile_photo?.url;
43
36
  return { name: item?.display_name, image, id: item?.id };
44
37
  });
@@ -127,7 +120,7 @@ const InstructorAccountSwitcher = ({
127
120
  }
128
121
  };
129
122
 
130
- return getAllAffiliateData?.data?.count && !search ? (
123
+ return getAllAffiliateData?.data?.results?.length > 0 && !search ? (
131
124
  <>
132
125
  {(setDefaultAffiliateData?.loading ||
133
126
  getDefaultAffiliateData?.loading ||