Skip to content

Commit

Permalink
Merge pull request #2560 from ever-co/2559-bug-languages-list-not-wor…
Browse files Browse the repository at this point in the history
…kin-on-authenitcation-page

Mod1
  • Loading branch information
evereq authored May 30, 2024
2 parents bdc3ef0 + 98f5e50 commit e4a993f
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 e4a993f

Please sign in to comment.