Fix resolving invalid claims (#7210)

This commit is contained in:
saltrafael 2021-10-01 13:00:57 -03:00 committed by GitHub
parent de6c6f9bfd
commit 56817d4e69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,7 @@
import { connect } from 'react-redux';
import { doResolveUri, makeSelectClaimForUri, makeSelectIsUriResolving } from 'lbry-redux';
import { doSetPlayingUri } from 'redux/actions/content';
import { punctuationMarks } from 'util/remark-lbry';
import { selectBlackListedOutpoints } from 'lbryinc';
import { selectPlayingUri } from 'redux/selectors/content';
import ClaimLink from './view';
@ -11,7 +12,7 @@ const select = (state, props) => {
function getValidClaim(testUri) {
claim = makeSelectClaimForUri(testUri)(state);
if (claim === null) {
if (claim === null && punctuationMarks.includes(testUri.charAt(testUri.length - 1))) {
getValidClaim(testUri.substring(0, testUri.length - 1));
} else {
uri = testUri;

View file

@ -3,7 +3,7 @@ import visit from 'unist-util-visit';
const protocol = 'lbry://';
const uriRegex = /(lbry:\/\/)[^\s"]*[^)]/g;
const punctuationMarks = [',', '.', '!', '?', ':', ';', '-', ']', ')', '}'];
export const punctuationMarks = [',', '.', '!', '?', ':', ';', '-', ']', ')', '}'];
const mentionToken = '@';
// const mentionTokenCode = 64; // @