Merge pull request #155 from zxawry/search-view
set correct suggestion type for lbry URIs
This commit is contained in:
commit
9c27201373
1 changed files with 7 additions and 6 deletions
|
@ -57,20 +57,21 @@ export const selectSearchSuggestions: Array<SearchSuggestion> = createSelector(
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryIsPrefix = query === 'lbry:' || query === 'lbry:/' || query === 'lbry://';
|
const queryIsPrefix =
|
||||||
|
query === 'lbry:' || query === 'lbry:/' || query === 'lbry://' || query === 'lbry://@';
|
||||||
|
|
||||||
if (query.startsWith('lbry://') && query !== 'lbry://') {
|
if (queryIsPrefix) {
|
||||||
|
// If it is a prefix, wait until something else comes to figure out what to do
|
||||||
|
return [];
|
||||||
|
} else if (query.startsWith('lbry://')) {
|
||||||
// If it starts with a prefix, don't show any autocomplete results
|
// If it starts with a prefix, don't show any autocomplete results
|
||||||
// They are probably typing/pasting in a lbry uri
|
// They are probably typing/pasting in a lbry uri
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
value: query,
|
value: query,
|
||||||
type: SEARCH_TYPES.FILE,
|
type: query[7] === '@' ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else if (queryIsPrefix) {
|
|
||||||
// If it is a prefix, wait until something else comes to figure out what to do
|
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let searchSuggestions = [];
|
let searchSuggestions = [];
|
||||||
|
|
Loading…
Reference in a new issue