Adding to playlists... seems buggy
This commit is contained in:
@ -107,10 +107,12 @@ class ContextMenu extends React.Component{
|
||||
|
||||
renderPlaylistSubmenu(){
|
||||
var playlists = []
|
||||
for( var i = 0; i < this.props.playlists.length; i++ ){
|
||||
if( this.props.playlists[i].can_edit ) playlists.push( this.props.playlists[i] )
|
||||
for (var uri in this.props.playlists){
|
||||
if (this.props.playlists[uri].can_edit) playlists.push( this.props.playlists[uri])
|
||||
}
|
||||
|
||||
playlists = helpers.sortItems(playlists, 'name')
|
||||
|
||||
return (
|
||||
<div className="submenu">
|
||||
{
|
||||
|
||||
@ -18,10 +18,12 @@ export default class AddToPlaylistModal extends React.Component{
|
||||
render(){
|
||||
if( !this.props.playlists ) return <div className="empty">No editable playlists</div>
|
||||
var playlists = []
|
||||
for( var i = 0; i < this.props.playlists.length; i++ ){
|
||||
if( this.props.playlists[i].can_edit ) playlists.push( this.props.playlists[i] )
|
||||
for (var uri in this.props.playlists){
|
||||
if( this.props.playlists[uri].can_edit ) playlists.push( this.props.playlists[uri] )
|
||||
}
|
||||
|
||||
playlists = helpers.sortItems(playlists, 'name')
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h4>Add to playlist</h4>
|
||||
|
||||
@ -351,7 +351,7 @@ export let sortItems = function (array, property, reverse = false){
|
||||
}
|
||||
}
|
||||
|
||||
var sorted = array.sort(compare)
|
||||
var sorted = Object.assign([], array.sort(compare))
|
||||
if( reverse ) sorted.reverse()
|
||||
return sorted
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user