some fixes for search

This commit is contained in:
Akinwale Ariwodola 2018-03-28 12:58:34 +01:00
parent 2ce9a5a600
commit 7444b37f82
3 changed files with 6 additions and 8 deletions

View file

@ -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
});

View file

@ -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,

View file

@ -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({