diff --git a/package.json b/package.json index 0ed185eee..ac28e3639 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@graasp/chatbox": "3.3.0", "@graasp/map": "1.19.0", "@graasp/query-client": "4.2.0", - "@graasp/sdk": "4.31.0", + "@graasp/sdk": "4.32.1", "@graasp/stylis-plugin-rtl": "2.2.0", "@graasp/translations": "1.39.0", "@graasp/ui": "5.3.0", diff --git a/src/components/Root.tsx b/src/components/Root.tsx index fef6ca9f7..c98a552db 100644 --- a/src/components/Root.tsx +++ b/src/components/Root.tsx @@ -10,13 +10,12 @@ import { ToastContainer } from 'react-toastify'; import { CssBaseline } from '@mui/material'; -import { langs } from '@graasp/translations'; +import { getCurrentAccountLang } from '@graasp/sdk'; +import { DEFAULT_LANG, langs } from '@graasp/translations'; import { ThemeProvider } from '@graasp/ui'; import * as Sentry from '@sentry/react'; -import { getCurrentAccountLang } from '@/utils/member'; - import i18nConfig from '../config/i18n'; import { QueryClientProvider, @@ -38,7 +37,9 @@ const ThemeWrapper = () => { langs={langs} languageSelectSx={{ mb: 2, mr: 2 }} i18n={i18nConfig} - defaultDirection={i18nConfig.dir(getCurrentAccountLang(currentMember))} + defaultDirection={i18nConfig.dir( + getCurrentAccountLang(currentMember, DEFAULT_LANG), + )} > diff --git a/src/utils/member.ts b/src/utils/member.ts index 6c5bd04b8..b74f3f555 100644 --- a/src/utils/member.ts +++ b/src/utils/member.ts @@ -1,17 +1,6 @@ -import { AccountType, CurrentAccount, Member } from '@graasp/sdk'; -import { DEFAULT_LANG } from '@graasp/translations'; +import { Member } from '@graasp/sdk'; export const getMemberById = ( members: Member[], id: string, ): Member | undefined => members.find(({ id: thisId }) => id === thisId); - -export const getCurrentAccountLang = ( - account: CurrentAccount | null | undefined, - // eslint-disable-next-line arrow-body-style -): string | undefined => { - if (account?.type === AccountType.Individual) { - return account.extra.lang; - } - return DEFAULT_LANG; -}; diff --git a/yarn.lock b/yarn.lock index 3b93698ce..71d675b86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,10 +1521,10 @@ __metadata: languageName: node linkType: hard -"@faker-js/faker@npm:9.0.1": - version: 9.0.1 - resolution: "@faker-js/faker@npm:9.0.1" - checksum: 10/708629605392fdbe06887ca9b083d73801c64b47917f790870b240858ab65cada14b52dddf2cb7e471ad0f6ddf66ea30e7ffda741c5ba9bd5c27318b47262279 +"@faker-js/faker@npm:9.0.3": + version: 9.0.3 + resolution: "@faker-js/faker@npm:9.0.3" + checksum: 10/60ea71c31d6bd6317184736de17daee415e229cab5e10a4146a19622f3eb22f49f42345ff339dc9261f0214ca1f9b019c63fd9aac842a2d359f135102788ec90 languageName: node linkType: hard @@ -1653,18 +1653,18 @@ __metadata: languageName: node linkType: hard -"@graasp/sdk@npm:4.31.0": - version: 4.31.0 - resolution: "@graasp/sdk@npm:4.31.0" +"@graasp/sdk@npm:4.32.1": + version: 4.32.1 + resolution: "@graasp/sdk@npm:4.32.1" dependencies: - "@faker-js/faker": "npm:9.0.1" + "@faker-js/faker": "npm:9.0.3" filesize: "npm:10.1.6" js-cookie: "npm:3.0.5" validator: "npm:13.12.0" peerDependencies: date-fns: ^3 || ^4.0.0 uuid: ^9 || ^10 - checksum: 10/9b2bf85a51cc12b6f2bdefeb7bbc0c615db9ea3188ace6d460b14e61503763aeab13fd2aa1c4135cee602c2c58465895569b2845b91d942982f96f5594dfd1d4 + checksum: 10/74125fa4c2aed104142cccc77e8a8a90d2ae303dcaae83e40198f7d30d6615ad3136532789b0d1c2f7034847937f238c046b9aee5fcee5d319bbe7be8cb4f257 languageName: node linkType: hard @@ -6473,7 +6473,7 @@ __metadata: "@graasp/chatbox": "npm:3.3.0" "@graasp/map": "npm:1.19.0" "@graasp/query-client": "npm:4.2.0" - "@graasp/sdk": "npm:4.31.0" + "@graasp/sdk": "npm:4.32.1" "@graasp/stylis-plugin-rtl": "npm:2.2.0" "@graasp/translations": "npm:1.39.0" "@graasp/ui": "npm:5.3.0"