Fix search

This commit is contained in:
liamcardenas 2018-03-08 22:46:03 -08:00
parent bd785502f4
commit abdc15989c
2 changed files with 8 additions and 8 deletions

View file

@ -45,7 +45,7 @@ class FileListSearch extends React.PureComponent {
{uris && uris.length {uris && uris.length
? uris.map( ? uris.map(
uri => uri =>
parseURI(uri).name[0] === '@' ? ( parseURI(uri).claimName[0] === '@' ? (
<ChannelTile key={uri} uri={uri} /> <ChannelTile key={uri} uri={uri} />
) : ( ) : (
<FileTile key={uri} uri={uri} /> <FileTile key={uri} uri={uri} />

View file

@ -128,7 +128,7 @@ export function parseURI(URI, requireProto = false) {
} }
return { return {
claim_name: claimName, claimName,
path, path,
isChannel, isChannel,
...(contentName ? { contentName } : {}), ...(contentName ? { contentName } : {}),
@ -192,8 +192,8 @@ export function buildURI(URIObj, includeProto = true) {
export function normalizeURI(URI) { export function normalizeURI(URI) {
if (URI.match(/pending_claim/)) return URI; if (URI.match(/pending_claim/)) return URI;
const { claim_name, path, bidPosition, claimSequence, claimId } = parseURI(URI); const { claimName, path, bidPosition, claimSequence, claimId } = parseURI(URI);
return buildURI({ claimName: claim_name, path, claimSequence, bidPosition, claimId }); return buildURI({ claimName, path, claimSequence, bidPosition, claimId });
} }
export function isURIValid(URI) { export function isURIValid(URI) {
@ -203,12 +203,12 @@ export function isURIValid(URI) {
} catch (error) { } catch (error) {
return false; return false;
} }
return parts && parts.claim_name; return parts && parts.claimName;
} }
export function isNameValid(claim_name, checkCase = true) { export function isNameValid(claimName, checkCase = true) {
const regexp = new RegExp('^[a-z0-9-]+$', checkCase ? '' : 'i'); const regexp = new RegExp('^[a-z0-9-]+$', checkCase ? '' : 'i');
return regexp.test(claim_name); return regexp.test(claimName);
} }
export function isURIClaimable(URI) { export function isURIClaimable(URI) {
@ -220,7 +220,7 @@ export function isURIClaimable(URI) {
} }
return ( return (
parts && parts &&
parts.claim_name && parts.claimName &&
!parts.claimId && !parts.claimId &&
!parts.bidPosition && !parts.bidPosition &&
!parts.claimSequence && !parts.claimSequence &&