diff --git a/package.json b/package.json index 34311b63..ddda56e3 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@emotion/react": "11.13.3", "@emotion/styled": "11.13.0", "@graasp/query-client": "4.0.1", - "@graasp/sdk": "github:graasp/graasp-sdk#add-member-util", + "@graasp/sdk": "4.32.1", "@graasp/stylis-plugin-rtl": "2.2.0", "@graasp/translations": "1.39.0", "@graasp/ui": "5.2.1", diff --git a/src/components/App.tsx b/src/components/App.tsx index 8fc2572e..9755cb2a 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -4,7 +4,7 @@ import { Outlet, Route, Routes } from 'react-router-dom'; import { Box } from '@mui/material'; -import { AccountType, buildSignInPath } from '@graasp/sdk'; +import { buildSignInPath, getCurrentAccountLang } from '@graasp/sdk'; import { DEFAULT_LANG } from '@graasp/translations'; import { Loader, SignedInWrapper } from '@graasp/ui'; @@ -39,10 +39,7 @@ const App = (): JSX.Element => { const { i18n } = useTranslation(); useEffect(() => { - const lang = - currentAccount?.type === AccountType.Individual - ? currentAccount?.extra?.lang || DEFAULT_LANG - : DEFAULT_LANG; + const lang = getCurrentAccountLang(currentAccount, DEFAULT_LANG); if (lang) { i18n.changeLanguage(lang); } diff --git a/yarn.lock b/yarn.lock index 11322e2e..ca949b6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1305,10 +1305,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 @@ -1375,18 +1375,18 @@ __metadata: languageName: node linkType: hard -"@graasp/sdk@github:graasp/graasp-sdk#add-member-util": - version: 4.32.0 - resolution: "@graasp/sdk@https://github.com/graasp/graasp-sdk.git#commit=014086fa8ce283e14c08cbdfc90ba3985b1d361a" +"@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/98cb221febc99eb97db0c2dffa5b9861908120d4bc2d47479ff2ab5752fa78bae305d929acc9df8c8d99ff20d6dc860ae6c10f3a612a7cf439b033616ad0cdf9 + checksum: 10/74125fa4c2aed104142cccc77e8a8a90d2ae303dcaae83e40198f7d30d6615ad3136532789b0d1c2f7034847937f238c046b9aee5fcee5d319bbe7be8cb4f257 languageName: node linkType: hard @@ -5436,7 +5436,7 @@ __metadata: "@emotion/react": "npm:11.13.3" "@emotion/styled": "npm:11.13.0" "@graasp/query-client": "npm:4.0.1" - "@graasp/sdk": "github:graasp/graasp-sdk#add-member-util" + "@graasp/sdk": "npm:4.32.1" "@graasp/stylis-plugin-rtl": "npm:2.2.0" "@graasp/translations": "npm:1.39.0" "@graasp/ui": "npm:5.2.1"