Babel and jest support classes
This commit is contained in:
@ -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',
|
||||
],
|
||||
};
|
||||
1
package.json
Executable file → Normal file
1
package.json
Executable file → Normal file
@ -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",
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user