mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 02:57:30 +00:00
Ensure we don't doubletime the marquee when changing skins
This commit is contained in:
parent
277847f6ea
commit
4b33fb54c6
1 changed files with 8 additions and 1 deletions
|
|
@ -76,11 +76,12 @@ class Marquee extends React.Component {
|
|||
this.state = { stepping: true, dragOffset: 0 };
|
||||
this.handleMouseDown = this.handleMouseDown.bind(this);
|
||||
this.getText = this.getText.bind(this);
|
||||
this.stepHandle = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const step = () => {
|
||||
setTimeout(() => {
|
||||
this.stepHandle = setTimeout(() => {
|
||||
if (this.state.stepping) {
|
||||
this.props.dispatch({ type: STEP_MARQUEE });
|
||||
}
|
||||
|
|
@ -92,6 +93,12 @@ class Marquee extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.stepHandle) {
|
||||
clearTimeout(this.stepHandle);
|
||||
}
|
||||
}
|
||||
|
||||
getText() {
|
||||
switch (this.props.userInput.focus) {
|
||||
case "balance":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue