Fix search suggestions 'View Channel' Bug
This commit is contained in:
parent
3a69f47347
commit
3f598f76d1
1 changed files with 11 additions and 1 deletions
|
@ -52,10 +52,20 @@ export const selectSearchSuggestions: Array<SearchSuggestion> = createSelector(
|
|||
} else if (query.startsWith('lbry://')) {
|
||||
// If it starts with a prefix, don't show any autocomplete results
|
||||
// They are probably typing/pasting in a lbry uri
|
||||
let type: string;
|
||||
try {
|
||||
const uri = normalizeURI(query);
|
||||
let { isChannel } = parseURI(uri);
|
||||
type = isChannel ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE;
|
||||
} catch (e) {
|
||||
console.log('Query not recognized: ' + query);
|
||||
type = SEARCH_TYPES.SEARCH;
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
value: query,
|
||||
type: query[7] === '@' ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE,
|
||||
type: type,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue