Fix top search for channels (#104)

This commit is contained in:
jessopb 2021-10-20 12:55:21 -04:00 committed by GitHub
parent c782f73f30
commit dcd00c2308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,10 +31,15 @@ export default function SearchPage(props: Props) {
const uriFromQuery = `lbry://${modifiedUrlQuery}`; const uriFromQuery = `lbry://${modifiedUrlQuery}`;
let streamName; let streamName;
let channelName;
let isValid = true; let isValid = true;
try { try {
({ streamName } = parseURI(uriFromQuery)); ({ streamName, channelName } = parseURI(uriFromQuery));
if (!streamName || !isNameValid(streamName)) { if (
(!streamName && !channelName) ||
(streamName && !isNameValid(streamName)) ||
(channelName && !isNameValid(channelName))
) {
isValid = false; isValid = false;
} }
} catch (e) { } catch (e) {