Browse Source

refs 121334: fix iimports

Futa Arai 2 years ago
parent
commit
ad24748a8e

+ 1 - 1
apps/app/src/components/Me/OtherSettings.tsx

@@ -7,8 +7,8 @@ import { UncontrolledTooltip } from 'reactstrap';
 
 
 import { apiv3Put } from '~/client/util/apiv3-client';
 import { apiv3Put } from '~/client/util/apiv3-client';
 import { toastSuccess, toastError } from '~/client/util/toastr';
 import { toastSuccess, toastError } from '~/client/util/toastr';
+import { useSWRxIsQuestionnaireEnabled } from '~/features/questionnaire/client/stores/questionnaire';
 import { useCurrentUser } from '~/stores/context';
 import { useCurrentUser } from '~/stores/context';
-import { useSWRxIsQuestionnaireEnabled } from '~/stores/questionnaire';
 
 
 const OtherSettings = (): JSX.Element => {
 const OtherSettings = (): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();

+ 5 - 2
apps/app/src/components/Me/PersonalSettings.jsx

@@ -53,7 +53,6 @@ const PersonalSettings = () => {
         Icon: () => <i className="icon-fw icon-settings"></i>,
         Icon: () => <i className="icon-fw icon-settings"></i>,
         Content: OtherSettings,
         Content: OtherSettings,
         i18n: t('Other Settings'),
         i18n: t('Other Settings'),
-        index: 6,
       },
       },
     };
     };
   }, [t]);
   }, [t]);
@@ -61,7 +60,11 @@ const PersonalSettings = () => {
   const getDefaultTabIndex = () => {
   const getDefaultTabIndex = () => {
     // e.g) '/me#password_settings' sets password settings tab as default
     // e.g) '/me#password_settings' sets password settings tab as default
     const tab = window.location.hash?.substring(1);
     const tab = window.location.hash?.substring(1);
-    return navTabMapping[tab]?.index;
+    let defaultTabIndex;
+    Object.keys(navTabMapping).forEach((key, i) => {
+      if (key === tab) { defaultTabIndex = i }
+    });
+    return defaultTabIndex;
   };
   };
 
 
   return (
   return (