Front: settings persistance (#108)

* Front: Add peristance dependencies

* Front: Fix Cross-platform persistance

* Front: Create Settings Slice

* Front: Use Redux State for settings

* Front: Check if access token is still valid

* Front: Create Language Gate to set correct language at startup

* Front: BEtter handling of Access Token validity
This commit is contained in:
Arthur Jamet
2022-11-26 14:18:06 +00:00
committed by GitHub
parent 8546c86332
commit 55526dbadc
10 changed files with 179 additions and 47 deletions
+18
View File
@@ -0,0 +1,18 @@
import { RootState, useSelector } from "../state/Store";
import i18n from "./i18n";
type LanguageGateProps = {
children: any;
}
/**
* Gate to handle language update at startup and on every dispatch
* @param props the children to render
*/
const LanguageGate = (props: LanguageGateProps) => {
const language = useSelector((state: RootState) => state.language.value);
i18n.changeLanguage(language);
return props.children;
}
export default LanguageGate;