cut staging from master #1070

Merged
jessopb merged 3 commits from master into staging 2020-06-10 23:14:01 +02:00
2 changed files with 11 additions and 2 deletions

View file

@ -3,7 +3,7 @@ import ErrorPage from '@pages/ErrorPage';
import ShowAssetLite from '@pages/ShowAssetLite';
import ShowAssetDetails from '@pages/ShowAssetDetails';
import ShowChannel from '@pages/ShowChannel';
import { withRouter } from 'react-router-dom';
import { withRouter, Redirect } from 'react-router-dom';
import {
CHANNEL,
@ -23,7 +23,14 @@ class ContentPageWrapper extends React.Component {
}
}
render () {
const { error, requestType } = this.props;
const { error, requestType, match } = this.props;
const { params } = match;
const { claim, identifier } = params;
if (identifier) {
return <Redirect to={`https://lbry.tv/${identifier}/${claim}`} />
} else {
return <Redirect to={`https://lbry.tv/${claim}`} />
}
if (error) {
return (
<ErrorPage error={error} />

View file

@ -104,6 +104,7 @@ export default (db, table, sequelize) => ({
.findAll({
where: {
name: claimName,
claim_type: 1,
publisher_id: channelClaimId,
bid_state: { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] },
},
@ -215,6 +216,7 @@ export default (db, table, sequelize) => ({
.findAll({
where: {
name: claimName,
claim_type: 1,
publisher_id: channelId,
},
})