diff --git a/babel.config.js b/babel.config.js index e6121487..be17c3e7 100755 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,9 @@ module.exports = { - presets: ['@babel/preset-env', '@babel/preset-react'], + presets: [ + '@babel/preset-env', + '@babel/preset-react', + ], + plugins: [ + '@babel/plugin-proposal-class-properties', + ], }; \ No newline at end of file diff --git a/package.json b/package.json old mode 100755 new mode 100644 index 92ffd702..04c3f772 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "react-router": "^5" }, "devDependencies": { + "@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/preset-env": "^7.7.1", "@babel/preset-react": "^7.7.0", "babel-core": "^6", diff --git a/src/js/services/mopidy/middleware.js b/src/js/services/mopidy/middleware.js index 685e4391..55749476 100755 --- a/src/js/services/mopidy/middleware.js +++ b/src/js/services/mopidy/middleware.js @@ -852,15 +852,15 @@ const MopidyMiddleware = (function () { case 'MOPIDY_PLAY_URIS': const { from_uri } = action; - let uris = Object.assign([], action.uris); + let urisToPlay = Object.assign([], action.uris); - if (!uris || !uris.length) { + if (!urisToPlay || !urisToPlay.length) { this.props.uiActions.createNotification({ content: 'No URIs to play', type: 'warning' }); break; } if (action.shuffle) { - action.uris = helpers.shuffle(action.uris); + urisToPlay = helpers.shuffle(urisToPlay); } // Stop the radio @@ -875,7 +875,7 @@ const MopidyMiddleware = (function () { // Shuffle/random mode if (store.getState().mopidy.random) { - var first_uri_index = Math.floor(Math.random() * action.uris.length); + var first_uri_index = Math.floor(Math.random() * urisToPlay.length); } else { var first_uri_index = 0; }