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 _batchActions = __webpack_require__(8);
var _batchActions2 = _interopRequireDefault(_batchActions);
var _handleFetch = __webpack_require__(27); var _handleFetch = __webpack_require__(27);
var _handleFetch2 = _interopRequireDefault(_handleFetch); var _handleFetch2 = _interopRequireDefault(_handleFetch);
@ -4031,8 +4029,8 @@ var doSearch = exports.doSearch = function doSearch(rawQuery) {
uris: uris uris: uris
} }
}); });
dispatch(_batchActions2.default.apply(undefined, actions)); dispatch(_batchActions.batchActions.apply(undefined, actions));
}).catch(function () { }).catch(function (e) {
dispatch({ dispatch({
type: ACTIONS.SEARCH_FAIL type: ACTIONS.SEARCH_FAIL
}); });

View file

@ -2,6 +2,7 @@ import * as ACTIONS from 'constants/action_types';
import * as SETTINGS from 'constants/settings'; import * as SETTINGS from 'constants/settings';
import Lbry from 'lbry'; import Lbry from 'lbry';
import Lbryapi from 'lbryapi'; import Lbryapi from 'lbryapi';
import { selectState as selectSearchState } from 'redux/selectors/search';
// types // types
export { Notification } from 'types/Notification'; export { Notification } from 'types/Notification';
@ -148,7 +149,6 @@ export {
selectNavLinks, selectNavLinks,
} from 'redux/selectors/navigation'; } from 'redux/selectors/navigation';
import { selectState as selectSearchState } from 'redux/selectors/search';
export { selectSearchState }; export { selectSearchState };
export { export {
makeSelectSearchUris, makeSelectSearchUris,

View file

@ -1,3 +1,4 @@
// @flow
import * as ACTIONS from 'constants/action_types'; import * as ACTIONS from 'constants/action_types';
import * as SEARCH_TYPES from 'constants/search'; import * as SEARCH_TYPES from 'constants/search';
import { normalizeURI, buildURI, parseURI } from 'lbryURI'; import { normalizeURI, buildURI, parseURI } from 'lbryURI';
@ -83,9 +84,8 @@ export const doUpdateSearchQuery = (query: string, shouldSkipSuggestions: ?boole
export const getSearchSuggestions = (value: string) => dispatch => { export const getSearchSuggestions = (value: string) => dispatch => {
const query = value.trim(); const query = value.trim();
const isPrefix = () => { const isPrefix = () =>
return query === '@' || query === 'lbry:' || query === 'lbry:/' || query === 'lbry://'; query === '@' || query === 'lbry:' || query === 'lbry:/' || query === 'lbry://';
};
if (!query || isPrefix()) { if (!query || isPrefix()) {
dispatch({ dispatch({