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:
@@ -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;
|
||||
Reference in New Issue
Block a user