diff --git a/js/actionCreators.js b/js/actionCreators.js
index ad2cafde..6e2534fc 100644
--- a/js/actionCreators.js
+++ b/js/actionCreators.js
@@ -61,6 +61,11 @@ export function adjustVolume(mediaPlayer, volumeDiff) {
};
}
+export function toggleRepeat(mediaPlayer) {
+ mediaPlayer.toggleRepeat();
+ return {type: 'TOGGLE_REPEAT'};
+}
+
export function setSkinFromFile(skinFile) {
return (dispatch) => {
dispatch({type: 'START_LOADING'});
diff --git a/js/components/MainWindow.jsx b/js/components/MainWindow.jsx
index 2f0bdf7b..50f2e1ee 100644
--- a/js/components/MainWindow.jsx
+++ b/js/components/MainWindow.jsx
@@ -86,7 +86,7 @@ const MainWindow = (props) => {
-
+
diff --git a/js/components/Repeat.jsx b/js/components/Repeat.jsx
index 0fad4347..0b308f8e 100644
--- a/js/components/Repeat.jsx
+++ b/js/components/Repeat.jsx
@@ -1,6 +1,8 @@
import React from 'react';
import {connect} from 'react-redux';
+import {toggleRepeat} from '../actionCreators';
+
class Repeat extends React.Component {
constructor(props) {
@@ -8,7 +10,7 @@ class Repeat extends React.Component {
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
- this.props.dispatch({type: 'TOGGLE_REPEAT'});
+ this.props.dispatch(toggleRepeat(this.props.mediaPlayer));
}
render() {
return {
// TODO: Figure out how to make this pure
winamp.openFileDialog();
return state;
- case 'TOGGLE_REPEAT':
- winamp.toggleRepeat();
- return state;
case 'TOGGLE_SHUFFLE':
winamp.toggleShuffle();
return state;
diff --git a/js/winamp.js b/js/winamp.js
index 0c309cbc..56985886 100755
--- a/js/winamp.js
+++ b/js/winamp.js
@@ -56,10 +56,6 @@ module.exports = {
this.media.seekToTime(this.media.timeElapsed() + seconds);
},
- toggleRepeat: function() {
- this.media.toggleRepeat();
- },
-
toggleShuffle: function() {
this.media.toggleShuffle();
},