init senseBox connect features
This commit is contained in:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user