Debug and History as nested URLs; Loader for local views fixes #89
This commit is contained in:
@ -56,9 +56,9 @@ ReactDOM.render(
|
||||
|
||||
<IndexRoute component={Queue} />
|
||||
<Route path="queue" component={Queue} />
|
||||
<Route path="queue-history" component={QueueHistory} />
|
||||
<Route path="queue/history" component={QueueHistory} />
|
||||
<Route path="settings" component={Settings} />
|
||||
<Route path="debug" component={Debug} />
|
||||
<Route path="settings/debug" component={Debug} />
|
||||
|
||||
<Route path="search/iris::search::type::query" component={Search} />
|
||||
<Route path="album/:uri" component={Album} />
|
||||
|
||||
@ -64,7 +64,7 @@ class Queue extends React.Component{
|
||||
Radio
|
||||
{this.props.radio && this.props.radio.enabled ? <span className="flag blue">On</span> : null}
|
||||
</button>
|
||||
<button onClick={e => hashHistory.push(global.baseURL+'queue-history')}>
|
||||
<button onClick={e => hashHistory.push(global.baseURL+'queue/history')}>
|
||||
<FontAwesome name="history" />
|
||||
History
|
||||
</button>
|
||||
|
||||
@ -165,7 +165,7 @@ class Settings extends React.Component{
|
||||
|
||||
var options = (
|
||||
<span>
|
||||
<button onClick={e => hashHistory.push(global.baseURL+'debug')}>
|
||||
<button onClick={e => hashHistory.push(global.baseURL+'settings/debug')}>
|
||||
<FontAwesome name="flask" />
|
||||
Debug
|
||||
</button>
|
||||
|
||||
@ -152,6 +152,17 @@ class LibraryLocalAlbums extends React.Component{
|
||||
</span>
|
||||
)
|
||||
|
||||
if (albums.length <= 0 && helpers.isLoading(this.props.load_queue,['mopidy_lookup','mopidy_browse'])){
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local albums" options={options} uiActions={this.props.uiActions} />
|
||||
<div className="body-loader">
|
||||
<div className="loader"></div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local albums" options={options} uiActions={this.props.uiActions} />
|
||||
|
||||
@ -6,6 +6,7 @@ import { bindActionCreators } from 'redux'
|
||||
import Header from '../../components/Header'
|
||||
import List from '../../components/List'
|
||||
|
||||
import * as helpers from '../../helpers'
|
||||
import * as uiActions from '../../services/ui/actions'
|
||||
import * as mopidyActions from '../../services/mopidy/actions'
|
||||
import * as spotifyActions from '../../services/spotify/actions'
|
||||
@ -54,6 +55,17 @@ class LibraryLocalArtists extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
if (artists.length <= 0 && helpers.isLoading(this.props.load_queue,['mopidy_lookup','mopidy_browse'])){
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local artists" />
|
||||
<div className="body-loader">
|
||||
<div className="loader"></div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local artists" />
|
||||
|
||||
@ -9,6 +9,7 @@ import Header from '../../components/Header'
|
||||
import List from '../../components/List'
|
||||
import TrackList from '../../components/TrackList'
|
||||
|
||||
import * as helpers from '../../helpers'
|
||||
import * as mopidyActions from '../../services/mopidy/actions'
|
||||
import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
@ -67,10 +68,6 @@ class LibraryLocalDirectory extends React.Component{
|
||||
}
|
||||
|
||||
render(){
|
||||
if( !this.props.directory ) return null
|
||||
|
||||
var items = this.arrange_directory( this.props.directory )
|
||||
|
||||
var options = null
|
||||
if (this.props.params.uri != 'local:directory' ){
|
||||
options = (
|
||||
@ -81,6 +78,19 @@ class LibraryLocalDirectory extends React.Component{
|
||||
)
|
||||
}
|
||||
|
||||
if (!this.props.directory || helpers.isLoading(this.props.load_queue,['mopidy_browse'])){
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local files" options={options} uiActions={this.props.uiActions} />
|
||||
<div className="body-loader">
|
||||
<div className="loader"></div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
var items = this.arrange_directory( this.props.directory )
|
||||
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local files" options={options} uiActions={this.props.uiActions} />
|
||||
|
||||
Reference in New Issue
Block a user