l-min-components 1.0.1033 → 1.0.1036

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.1033",
3
+ "version": "1.0.1036",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -102,18 +102,20 @@ const InstructorAccountSwitcher = ({
102
102
  }, []);
103
103
 
104
104
  useEffect(() => {
105
- handleGetDefaultAffiliate().then((res) => {
106
- if (res?.data) {
107
- const value = res?.data;
108
- const image = value?.profile_photo?.url;
109
- setSelectedValue(() => ({
110
- name: value?.display_name,
111
- image,
112
- id: value?.id,
113
- }));
114
- }
115
- });
116
- }, []);
105
+ if (getAllAffiliateData?.data?.results?.length > 0) {
106
+ handleGetDefaultAffiliate().then((res) => {
107
+ if (res?.data) {
108
+ const value = res?.data;
109
+ const image = value?.profile_photo?.url;
110
+ setSelectedValue(() => ({
111
+ name: value?.display_name,
112
+ image,
113
+ id: value?.id,
114
+ }));
115
+ }
116
+ });
117
+ }
118
+ }, [getAllAffiliateData?.data]);
117
119
 
118
120
  const handleSelection = async (item) => {
119
121
  const res = await handleSetDefaultAffiliate({