From 9900954a563a11a6fe2f69ad73ca20ab2d96b8aa Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Mon, 4 Sep 2017 21:25:57 +1200 Subject: [PATCH] Make sure we have an initial query --- src/js/views/Search.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/views/Search.js b/src/js/views/Search.js index 9f3e1a31..26492a37 100755 --- a/src/js/views/Search.js +++ b/src/js/views/Search.js @@ -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) + } } }