mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-28 12:36:35 +00:00
Move stepping check out of reducers
This commit is contained in:
parent
8ba5e1bb5b
commit
2198842889
2 changed files with 4 additions and 8 deletions
|
|
@ -14,7 +14,9 @@ class Marquee extends React.Component {
|
|||
componentDidMount() {
|
||||
const step = () => {
|
||||
setTimeout(() => {
|
||||
this.props.dispatch({type: 'STEP_MARQUEE'});
|
||||
if (this.props.stepping) {
|
||||
this.props.dispatch({type: 'STEP_MARQUEE'});
|
||||
}
|
||||
step();
|
||||
}, 220);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,14 +36,8 @@ const marquee = (state, action) => {
|
|||
]
|
||||
};
|
||||
}
|
||||
state = Object.assign({}, state, {registers: state.registers.map(r => register(r, action))});
|
||||
switch (action.type) {
|
||||
case 'SET_MARQUEE_REGISTER':
|
||||
return Object.assign({}, state, {registers: state.registers.map(r => register(r, action))});
|
||||
case 'STEP_MARQUEE':
|
||||
if (state.stepping) {
|
||||
return Object.assign({}, state, {registers: state.registers.map(r => register(r, action))});
|
||||
}
|
||||
return state;
|
||||
case 'SHOW_MARQUEE_REGISTER':
|
||||
if (state.stepping) {
|
||||
return Object.assign({}, state, {selectedRegister: action.register});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue