Make sure we have an initial query

This commit is contained in:
James Barnsley
2017-09-04 21:25:57 +12:00
parent 3fdef74dc0
commit 9900954a56

View File

@ -32,12 +32,14 @@ class Search extends React.Component{
// Auto-focus on the input field
$(document).find('.search-form input').focus();
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes){
this.props.mopidyActions.getSearchResults(this.props.view, this.props.params.query)
}
if (this.props.params.query && this.props.params.query !== ''){
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes){
this.props.mopidyActions.getSearchResults(this.props.view, this.props.params.query)
}
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes && this.props.search_settings.uri_schemes.includes('spotify:')){
this.props.spotifyActions.getSearchResults(this.props.view, this.props.params.query)
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes && this.props.search_settings.uri_schemes.includes('spotify:')){
this.props.spotifyActions.getSearchResults(this.props.view, this.props.params.query)
}
}
}