Corrected the usage of getState() funciotn in i18n.js.

This commit is contained in:
rkhatta1 committed 2025-02-10 10:38:51 -07:00
1 parent 590338a48b
commit 46e27a69f3
1 file changed
+3 -2
+3 -2
View File
@@ -15,11 +15,12 @@ Object.keys(translations).forEach((path) => {
};
});
const savedLanguage = store.getState.ui.language || primaryLanguage;
const savedLanguage = store.getState()?.ui?.language;
const initialLanguage = savedLanguage || primaryLanguage;
i18n.use(initReactI18next).init({
resources,
lng: savedLanguage,
lng: initialLanguage,
fallbackLng: primaryLanguage,
debug: import.meta.env.MODE === "development",
ns: ["translation"],