feat: update
This commit is contained in:
@ -10,4 +10,4 @@ export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, va
|
||||
|
||||
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
||||
|
||||
export const setServiceUrls = (value: AppState['serviceUrls']) => ({ type: SET_SERVICE_URLS, value });
|
||||
export const setCityOperators = (value: AppState['cityOperators']) => ({ type: SET_SERVICE_URLS, value });
|
||||
|
||||
@ -23,7 +23,7 @@ const INIT_STATE: AppState = {
|
||||
roleType: defaultAppMode,
|
||||
homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB,
|
||||
location: Taro.getStorageSync<LocationInfo>(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION,
|
||||
serviceUrls: [],
|
||||
cityOperators: [],
|
||||
};
|
||||
|
||||
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
||||
@ -35,7 +35,7 @@ const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
||||
case CHANGE_HOME_PAGE:
|
||||
return { ...state, homePageType: value };
|
||||
case SET_SERVICE_URLS:
|
||||
return { ...state, serviceUrls: value };
|
||||
return { ...state, cityOperators: value };
|
||||
case SET_LOCATION_INFO:
|
||||
Taro.setStorageSync(CacheKey.CACHE_LOCATION_INFO, value);
|
||||
return { ...state, location: value };
|
||||
|
||||
@ -6,4 +6,4 @@ export const selectHomePageType = (state: IState) => state.appState.homePageType
|
||||
|
||||
export const selectLocation = (state: IState) => state.appState.location;
|
||||
|
||||
export const selectServiceUrls = (state: IState) => state.appState.serviceUrls || {};
|
||||
export const selectCityOperators = (state: IState) => state.appState.cityOperators || {};
|
||||
|
||||
Reference in New Issue
Block a user