2f4dedfba2
* Add Channel Mention selection ability * Fix mentioned user name being smaller than other text * Improve logic for locating a mention * Fix mentioning with enter on livestream * Fix breaking for invalid URI query * Handle punctuation after mention * Fix name display and appeareance * Use canonical url * Fix missing search
32 lines
952 B
JavaScript
32 lines
952 B
JavaScript
import { connect } from 'react-redux';
|
|
import { doResolveUri, makeSelectClaimForUri, makeSelectIsUriResolving } from 'lbry-redux';
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
import { selectBlackListedOutpoints } from 'lbryinc';
|
|
import { selectPlayingUri } from 'redux/selectors/content';
|
|
import ClaimLink from './view';
|
|
|
|
const select = (state, props) => {
|
|
let uri = props.uri;
|
|
let claim;
|
|
|
|
function getValidClaim(testUri) {
|
|
claim = makeSelectClaimForUri(testUri)(state);
|
|
if (claim === null) {
|
|
getValidClaim(testUri.substring(0, testUri.length - 1));
|
|
} else {
|
|
uri = testUri;
|
|
}
|
|
}
|
|
getValidClaim(uri);
|
|
|
|
return {
|
|
uri,
|
|
claim,
|
|
fullUri: props.uri,
|
|
isResolvingUri: makeSelectIsUriResolving(uri)(state),
|
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
|
playingUri: selectPlayingUri(state),
|
|
};
|
|
};
|
|
|
|
export default connect(select, { doResolveUri, doSetPlayingUri })(ClaimLink);
|