mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-28 23:19:35 -06:00
Rename set data loader isActive action
This commit is contained in:
committed by
Matthias Berg
parent
2f13e8665b
commit
fd48d870c3
@@ -30,5 +30,5 @@ export const actionTypes = {
|
||||
setClickablePoint: 'TRANSFERFUNCTION_TOGGLE_CLICKABLE_POINT',
|
||||
|
||||
// action types for data loader
|
||||
toggleDataLoaderActivated: 'DATA_LOADER_TOGGLE_ACTIVATED',
|
||||
setDataLoaderActivated: 'DATA_LOADER_TOGGLE_ACTIVATED',
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { actionTypes } from './actionTypes';
|
||||
|
||||
export const toggleActivated = (activated) => ({
|
||||
type: actionTypes.toggleDataLoaderActivated,
|
||||
export const setActivated = (isActivated) => ({
|
||||
type: actionTypes.setDataLoaderActivated,
|
||||
payload: {
|
||||
activated
|
||||
activated: isActivated
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import { actionTypes } from '../Actions/actionTypes';
|
||||
|
||||
export const dataLoader = (state = {}, action) => {
|
||||
switch(action.type) {
|
||||
case actionTypes.toggleDataLoaderActivated:
|
||||
case actionTypes.setDataLoaderActivated:
|
||||
const { activated } = action.payload;
|
||||
|
||||
return {
|
||||
|
||||
@@ -2,7 +2,6 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { toggleActivated } from '../../../api/Actions/dataLoaderActions';
|
||||
|
||||
import TabMenuItem from '../../common/TabMenu/TabMenuItem';
|
||||
import Label from '../../common/Label/Label';
|
||||
|
||||
@@ -32,15 +31,9 @@ const mapStateToProps = state => ({
|
||||
activated: state.dataLoader.activated
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
toggleActivated: (activated) => {
|
||||
dispatch(toggleActivated(activated));
|
||||
}
|
||||
});
|
||||
|
||||
ToggleDataLoader = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
null
|
||||
)(ToggleDataLoader);
|
||||
|
||||
export default ToggleDataLoader;
|
||||
|
||||
Reference in New Issue
Block a user