Babel and jest support classes

This commit is contained in:
James Barnsley
2020-01-23 06:21:05 +13:00
parent d66f073bca
commit 7bbf9621ab
3 changed files with 12 additions and 5 deletions

View File

@ -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;
}