init senseBox connect features

This commit is contained in:
Mario Pesch
2021-10-01 15:06:22 +02:00
parent e528a78e77
commit faabd9e693
5 changed files with 237 additions and 102 deletions
+14 -8
View File
@@ -1,32 +1,38 @@
import { VISIT, LANGUAGE, RENDERER, STATISTICS } from './types';
import { VISIT, LANGUAGE, RENDERER, STATISTICS, PLATFORM } from "./types";
export const visitPage = () => (dispatch) => {
dispatch({
type: VISIT
type: VISIT,
});
};
export const setPlatform = (platform) => (dispatch) => {
dispatch({
type: PLATFORM,
payload: platform,
});
};
export const setLanguage = (language) => (dispatch, getState) => {
if(!getState().auth.progress && !getState().auth.isAuthenticated){
window.localStorage.setItem('locale', language);
if (!getState().auth.progress && !getState().auth.isAuthenticated) {
window.localStorage.setItem("locale", language);
}
dispatch({
type: LANGUAGE,
payload: language
payload: language,
});
};
export const setRenderer = (renderer) => (dispatch) => {
dispatch({
type: RENDERER,
payload: renderer
payload: renderer,
});
};
export const setStatistics = (showStatistics) => (dispatch) => {
dispatch({
type: STATISTICS,
payload: showStatistics
payload: showStatistics,
});
};
+1
View File
@@ -43,6 +43,7 @@ export const PROGRESS = "PROGRESS";
export const VISIT = "VISIT";
export const LANGUAGE = "LANGUAGE";
export const PLATFORM = "PLATFORM";
export const RENDERER = "RENDERER";
export const STATISTICS = "STATISTICS";