diff --git a/src/containers/alerts.jsx b/src/containers/alerts.jsx index 12b7b6b3e180215785c0131581074be148928126..96d8151cdc8d23c565d5e1d8dfe5595092a5eb70 100644 --- a/src/containers/alerts.jsx +++ b/src/containers/alerts.jsx @@ -1,7 +1,7 @@ import {connect} from 'react-redux'; import { - viewAlert + showAlert } from '../reducers/alerts'; import AlertsComponent from '../components/alerts/alerts.jsx'; @@ -12,7 +12,7 @@ const mapStateToProps = state => ({ }); const mapDispatchToProps = dispatch => ({ - onViewAlert: () => dispatch(viewAlert()) + onShowAlert: () => dispatch(showAlert()) }); export default connect( diff --git a/src/lib/vm-listener-hoc.jsx b/src/lib/vm-listener-hoc.jsx index 7c3d22c878c60d723044c7f157c6c4e70caf69a8..9d7e3ecd0772fbfa44a547e985b5d9ed0796a5a6 100644 --- a/src/lib/vm-listener-hoc.jsx +++ b/src/lib/vm-listener-hoc.jsx @@ -9,7 +9,7 @@ import {updateTargets} from '../reducers/targets'; import {updateBlockDrag} from '../reducers/block-drag'; import {updateMonitors} from '../reducers/monitors'; import {setRunningState, setTurboState} from '../reducers/vm-status'; -import {viewAlert} from '../reducers/alerts'; +import {showAlert} from '../reducers/alerts'; /* * Higher Order Component to manage events emitted by the VM @@ -37,7 +37,7 @@ const vmListenerHOC = function (WrappedComponent) { this.props.vm.on('TURBO_MODE_OFF', this.props.onTurboModeOff); this.props.vm.on('PROJECT_RUN_START', this.props.onProjectRunStart); this.props.vm.on('PROJECT_RUN_STOP', this.props.onProjectRunStop); - this.props.vm.on('PERIPHERAL_CONNECTED', this.props.onViewAlert); + this.props.vm.on('PERIPHERAL_CONNECTED', this.props.onShowAlert); } componentDidMount () { if (this.props.attachKeyboardEvents) { @@ -95,7 +95,7 @@ const vmListenerHOC = function (WrappedComponent) { onProjectRunStop, onTurboModeOff, onTurboModeOn, - onViewAlert, + onShowAlert, /* eslint-enable no-unused-vars */ ...props } = this.props; @@ -139,7 +139,7 @@ const vmListenerHOC = function (WrappedComponent) { onProjectRunStop: () => dispatch(setRunningState(false)), onTurboModeOn: () => dispatch(setTurboState(true)), onTurboModeOff: () => dispatch(setTurboState(false)), - onViewAlert: () => dispatch(viewAlert()) + onShowAlert: () => dispatch(showAlert()) }); return connect( mapStateToProps, diff --git a/src/reducers/alerts.js b/src/reducers/alerts.js index 22bdfa760080a509653215d01f02e889794d8884..255cc3173fd323ec89896ecb07e37753cb01bdc6 100644 --- a/src/reducers/alerts.js +++ b/src/reducers/alerts.js @@ -1,5 +1,5 @@ const CLOSE_ALERT = 'scratch-gui/alerts/CLOSE_ALERT'; -const VIEW_ALERT = 'scratch-gui/alerts/VIEW_ALERT'; +const SHOW_ALERT = 'scratch-gui/alerts/SHOW_ALERT'; const initialState = { message: 'testing alerts!!', @@ -9,7 +9,7 @@ const initialState = { const reducer = function (state, action) { if (typeof state === 'undefined') state = initialState; switch (action.type) { - case VIEW_ALERT: + case SHOW_ALERT: return Object.assign({}, state, { visible: true }); @@ -26,13 +26,13 @@ const closeAlert = function () { return {type: CLOSE_ALERT}; }; -const viewAlert = function () { - return {type: VIEW_ALERT}; +const showAlert = function () { + return {type: SHOW_ALERT}; }; export { reducer as default, initialState as alertsInitialState, closeAlert, - viewAlert + showAlert };