l-min-components 1.0.910 → 1.0.916

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.910",
3
+ "version": "1.0.916",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -212,7 +212,7 @@ const AppMainLayout = () => {
212
212
  ) : (
213
213
  <>
214
214
  {isTranslationsLoading && Object.keys(translations)?.length === 0 ? (
215
- <> </>
215
+ <FullPageLoader hasBackground fixed={true} />
216
216
  ) : (
217
217
  <Layout
218
218
  coming={coming}
@@ -79,6 +79,7 @@ const HeaderComponent = (props) => {
79
79
  handleGetUnreadNotification();
80
80
  }, []);
81
81
 
82
+
82
83
  // Merge the notification_count into the results data using find
83
84
 
84
85
  const allUserAccountsDetail = userAccountsDetail?.data?.results.map(
@@ -380,12 +381,6 @@ const HeaderComponent = (props) => {
380
381
  handleGeneralNotificationCount();
381
382
  }, [notificationMarkReadData?.response]);
382
383
 
383
-
384
-
385
- const value = JSON?.parse(localStorage.getItem("defaultLang"));
386
- const currentFlag = value?.flag;
387
- const selectedLanguage = languagesData?.find((lang) => lang?.slug === props.defaultLang);
388
-
389
384
  // When Developer and on staging
390
385
  const isDeveloper =
391
386
  generalData?.selectedAccount?.type === "DEVELOPER" &&
@@ -394,6 +389,24 @@ const HeaderComponent = (props) => {
394
389
  const isPendingDelete =
395
390
  generalData?.selectedAccount?.pending_delete === true &&
396
391
  window.location.hostname.includes("staging");
392
+
393
+ const value = JSON?.parse(localStorage.getItem("defaultLang"));
394
+ const currentFlag = value?.flag;
395
+ const selectedLanguage = languagesData?.find((lang) => lang?.slug === props.defaultLang);
396
+
397
+ // update default language state from api
398
+ useEffect(() => {
399
+ if(getDefaultAccount?.data?.language) {
400
+ props.setDefaultLang(getDefaultAccount?.data?.language);
401
+
402
+ if(getDefaultAccount?.data?.language === props.defaultLang) {
403
+ localStorage.setItem("defaultLang", JSON.stringify(selectedLanguage));
404
+ }
405
+ }
406
+
407
+
408
+ }, [getDefaultAccount?.data, props.defaultLang])
409
+
397
410
 
398
411
  return (
399
412
  <Navbar>
@@ -52,7 +52,6 @@ const useTranslation = (initialSentences = []) => {
52
52
  const newTranslations = {};
53
53
  initialSentences.map((word, index) => {
54
54
  newTranslations[word] = translateData?.data?.result[index];
55
- console.log(translateData?.data?.result, "result")
56
55
  });
57
56
  setTranslations((prevTranslations) => ({
58
57
  ...prevTranslations,
@@ -67,7 +66,7 @@ const useTranslation = (initialSentences = []) => {
67
66
  setIsTranslationsLoading(false)
68
67
  }
69
68
  }, [translations])
70
-
69
+ console.log("translateData", translateData)
71
70
 
72
71
 
73
72
  return {