Skip to content

Commit

Permalink
Mod1
Browse files Browse the repository at this point in the history
bug: languages not fetching in auth pages
  • Loading branch information
Anishali2 committed May 29, 2024
1 parent d8815b6 commit 98f5e50
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions apps/web/app/hooks/features/useLanguageSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ export function useLanguageSettings() {

const loadLanguagesData = useCallback(() => {
setActiveLanguageId(getActiveLanguageIdCookie());
if (user) {
return queryCall(user.role.isSystem).then((res) => {
setLanguages(
res?.data?.items.filter((item: any) => APPLICATION_LANGUAGES_CODE.includes(item.code)) || []
);
return res;
});
}
return queryCall(user?.role?.isSystem ?? false).then((res) => {
setLanguages(res?.data?.items.filter((item: any) => APPLICATION_LANGUAGES_CODE.includes(item.code)) || []);
return res;
});
}, [queryCall, setActiveLanguageId, setLanguages, user]);

const setActiveLanguage = useCallback(
Expand Down

0 comments on commit 98f5e50

Please sign in to comment.