Fix Mis-typed claimLink #7210

Merged
saltrafael merged 1 commit from channel-mention into master 2021-10-01 18:00:58 +02:00
2 changed files with 3 additions and 2 deletions

View file

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

View file

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