From a232c3f48b99e078da967e01e90b9a29817e5d8a Mon Sep 17 00:00:00 2001 From: saltrafael Date: Fri, 1 Oct 2021 12:45:09 -0300 Subject: [PATCH] Fix resolving invalid claims --- ui/component/claimLink/index.js | 3 ++- ui/util/remark-lbry.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/component/claimLink/index.js b/ui/component/claimLink/index.js index 39bd1e9f9..6aaed830a 100644 --- a/ui/component/claimLink/index.js +++ b/ui/component/claimLink/index.js @@ -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; diff --git a/ui/util/remark-lbry.js b/ui/util/remark-lbry.js index fc8bb17e6..ad0ea9145 100644 --- a/ui/util/remark-lbry.js +++ b/ui/util/remark-lbry.js @@ -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; // @ -- 2.45.2