From 7444b37f82f324b0508d0de9bec36ed70e694470 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 28 Mar 2018 12:58:34 +0100 Subject: [PATCH] some fixes for search --- build/index.js | 6 ++---- src/index.js | 2 +- src/redux/actions/search.js | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/build/index.js b/build/index.js index 1350800..04b9ab6 100644 --- a/build/index.js +++ b/build/index.js @@ -3969,8 +3969,6 @@ var _search2 = __webpack_require__(13); var _batchActions = __webpack_require__(8); -var _batchActions2 = _interopRequireDefault(_batchActions); - var _handleFetch = __webpack_require__(27); var _handleFetch2 = _interopRequireDefault(_handleFetch); @@ -4031,8 +4029,8 @@ var doSearch = exports.doSearch = function doSearch(rawQuery) { uris: uris } }); - dispatch(_batchActions2.default.apply(undefined, actions)); - }).catch(function () { + dispatch(_batchActions.batchActions.apply(undefined, actions)); + }).catch(function (e) { dispatch({ type: ACTIONS.SEARCH_FAIL }); diff --git a/src/index.js b/src/index.js index 06f21c7..92507d4 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import * as ACTIONS from 'constants/action_types'; import * as SETTINGS from 'constants/settings'; import Lbry from 'lbry'; import Lbryapi from 'lbryapi'; +import { selectState as selectSearchState } from 'redux/selectors/search'; // types export { Notification } from 'types/Notification'; @@ -148,7 +149,6 @@ export { selectNavLinks, } from 'redux/selectors/navigation'; -import { selectState as selectSearchState } from 'redux/selectors/search'; export { selectSearchState }; export { makeSelectSearchUris, diff --git a/src/redux/actions/search.js b/src/redux/actions/search.js index c96d4a4..5908f1f 100644 --- a/src/redux/actions/search.js +++ b/src/redux/actions/search.js @@ -1,3 +1,4 @@ +// @flow import * as ACTIONS from 'constants/action_types'; import * as SEARCH_TYPES from 'constants/search'; import { normalizeURI, buildURI, parseURI } from 'lbryURI'; @@ -83,9 +84,8 @@ export const doUpdateSearchQuery = (query: string, shouldSkipSuggestions: ?boole export const getSearchSuggestions = (value: string) => dispatch => { const query = value.trim(); - const isPrefix = () => { - return query === '@' || query === 'lbry:' || query === 'lbry:/' || query === 'lbry://'; - }; + const isPrefix = () => + query === '@' || query === 'lbry:' || query === 'lbry:/' || query === 'lbry://'; if (!query || isPrefix()) { dispatch({