Only load library playlists if not loaded already

This commit is contained in:
James Barnsley
2017-08-11 22:05:53 +12:00
parent 9bb4b79f1e
commit 6d2bf7ff87
2 changed files with 10 additions and 2 deletions

View File

@ -332,6 +332,14 @@ class ContextMenu extends React.Component{
}
}
setPlaylistSubmenu(expanded = !this.state.submenu_expanded){
this.setState({submenu_expanded: expanded})
if (expanded && !this.props.library_playlists){
this.props.coreActions.getLibraryPlaylists()
}
}
renderItems(){
var context = this.getContext()
@ -385,7 +393,7 @@ class ContextMenu extends React.Component{
var add_to_playlist = (
<span className="menu-item-wrapper has-submenu">
<a className="menu-item" onClick={e => {this.setState({ submenu_expanded: !this.state.submenu_expanded }); this.props.coreActions.getLibraryPlaylists()}}>
<a className="menu-item" onClick={e => this.setPlaylistSubmenu()}>
<span className="label">Add to playlist</span>
<FontAwesome className="submenu-icon" name='caret-right' />
</a>

View File

@ -91,7 +91,7 @@
}
}
&:active {
.notouch &:active {
background: $black;
color: $white;
}