removes obsolete pending_claim regex match
This commit is contained in:
parent
03aea43da5
commit
605b797fa9
2 changed files with 9 additions and 14 deletions
9
dist/bundle.js
vendored
9
dist/bundle.js
vendored
|
@ -1393,10 +1393,9 @@ function parseURI(URI) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (claimId && (claimId.length > claimIdMaxLength || !claimId.match(/^[0-9a-f]+$/)) && !claimId.match(/^pending/) // ought to be dropped when savePendingPublish drops hack
|
if (claimId && (claimId.length > claimIdMaxLength || !claimId.match(/^[0-9a-f]+$/))) {
|
||||||
) {
|
throw new Error(__('Invalid claim ID %s.', claimId));
|
||||||
throw new Error(__('Invalid claim ID %s.', claimId));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) {
|
if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) {
|
||||||
throw new Error(__('Claim sequence must be a number.'));
|
throw new Error(__('Claim sequence must be a number.'));
|
||||||
|
@ -1471,8 +1470,6 @@ function buildURI(URIObj) {
|
||||||
|
|
||||||
/* Takes a parseable LBRY URI and converts it to standard, canonical format */
|
/* Takes a parseable LBRY URI and converts it to standard, canonical format */
|
||||||
function normalizeURI(URI) {
|
function normalizeURI(URI) {
|
||||||
if (URI.match(/pending_claim/)) return URI;
|
|
||||||
|
|
||||||
var _parseURI = parseURI(URI),
|
var _parseURI = parseURI(URI),
|
||||||
claimName = _parseURI.claimName,
|
claimName = _parseURI.claimName,
|
||||||
path = _parseURI.path,
|
path = _parseURI.path,
|
||||||
|
|
|
@ -95,11 +95,7 @@ export function parseURI(URI, requireProto = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (claimId && (claimId.length > claimIdMaxLength || !claimId.match(/^[0-9a-f]+$/))) {
|
||||||
claimId &&
|
|
||||||
(claimId.length > claimIdMaxLength || !claimId.match(/^[0-9a-f]+$/)) &&
|
|
||||||
!claimId.match(/^pending/) // ought to be dropped when savePendingPublish drops hack
|
|
||||||
) {
|
|
||||||
throw new Error(__(`Invalid claim ID %s.`, claimId));
|
throw new Error(__(`Invalid claim ID %s.`, claimId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,8 +186,6 @@ export function buildURI(URIObj, includeProto = true, protoDefault = 'lbry://')
|
||||||
|
|
||||||
/* Takes a parseable LBRY URI and converts it to standard, canonical format */
|
/* Takes a parseable LBRY URI and converts it to standard, canonical format */
|
||||||
export function normalizeURI(URI) {
|
export function normalizeURI(URI) {
|
||||||
if (URI.match(/pending_claim/)) return URI;
|
|
||||||
|
|
||||||
const { claimName, path, bidPosition, claimSequence, claimId } = parseURI(URI);
|
const { claimName, path, bidPosition, claimSequence, claimId } = parseURI(URI);
|
||||||
return buildURI({ claimName, path, claimSequence, bidPosition, claimId });
|
return buildURI({ claimName, path, claimSequence, bidPosition, claimId });
|
||||||
}
|
}
|
||||||
|
@ -231,5 +225,9 @@ export function isURIClaimable(URI) {
|
||||||
|
|
||||||
export function convertToShareLink(URI) {
|
export function convertToShareLink(URI) {
|
||||||
const { claimName, path, bidPosition, claimSequence, claimId } = parseURI(URI);
|
const { claimName, path, bidPosition, claimSequence, claimId } = parseURI(URI);
|
||||||
return buildURI({ claimName, path, claimSequence, bidPosition, claimId }, true, 'https://open.lbry.io/');
|
return buildURI(
|
||||||
|
{ claimName, path, claimSequence, bidPosition, claimId },
|
||||||
|
true,
|
||||||
|
'https://open.lbry.io/'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue