From 26c62fc326c359cf11e8dc116608f751ad9a991a Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Wed, 21 Feb 2018 11:10:36 -0800 Subject: [PATCH] Update claim_name to cammel case in lbryuri --- src/renderer/component/fileList/view.jsx | 2 +- src/renderer/lbryURI.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index 51670e0f5..4b737189c 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -74,7 +74,7 @@ class FileList extends React.PureComponent { uriParams.claimId = this.getChannelSignature(fileInfo); } else { uriParams.claimId = fileInfo.claim_id; - uriParams.claim_name = fileInfo.claim_name; + uriParams.claimName = fileInfo.claim_name; } const uri = buildURI(uriParams); diff --git a/src/renderer/lbryURI.js b/src/renderer/lbryURI.js index b611e4707..ba0aff2ec 100644 --- a/src/renderer/lbryURI.js +++ b/src/renderer/lbryURI.js @@ -34,7 +34,7 @@ export function parseURI(URI, requireProto = false) { '([:$#]?)([^/]*)' + // modifier separator, modifier (stops at the first path separator or end) '(/?)(.*)' // path separator, path ); - const [proto, claim_name, modSep, modVal, pathSep, path] = componentsRegex + const [proto, claimName, modSep, modVal, pathSep, path] = componentsRegex .exec(URI) .slice(1) .map(match => match || null); @@ -47,12 +47,12 @@ export function parseURI(URI, requireProto = false) { } // Validate and process name - if (!claim_name) { + if (!claimName) { throw new Error(__('URI does not include name.')); } - const isChannel = claim_name.startsWith('@'); - const channelName = isChannel ? claim_name.slice(1) : claim_name; + const isChannel = claimName.startsWith('@'); + const channelName = isChannel ? claimName.slice(1) : claimName; if (isChannel) { if (!channelName) { @@ -66,7 +66,7 @@ export function parseURI(URI, requireProto = false) { contentName = path; } - const nameBadChars = (channelName || claim_name).match(regexInvalidURI); + const nameBadChars = (channelName || claimName).match(regexInvalidURI); if (nameBadChars) { throw new Error( __( @@ -128,7 +128,7 @@ export function parseURI(URI, requireProto = false) { } return { - claim_name, + claim_name: claimName, path, isChannel, ...(contentName ? { contentName } : {}),