Merge pull request #1501 from lbryio/editing-claim-fix

fix: use short form uri when preparingEdit so users know they are editing
This commit is contained in:
Sean Yesmunt 2018-05-23 23:42:47 -04:00 committed by GitHub
commit f4a96e343a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -129,6 +129,14 @@ class FilePage extends React.Component<Props> {
subscriptionUri = buildURI({ channelName, claimId: channelClaimId }, false); subscriptionUri = buildURI({ channelName, claimId: channelClaimId }, false);
} }
// We want to use the short form uri for editing
// This is what the user is used to seeing, they don't care about the claim id
// We will select the claim id before they publish
let editUri;
if (claimIsMine) {
editUri = buildURI({ channelName, contentName: claim.name });
}
const isPlaying = playingUri === uri && !isPaused; const isPlaying = playingUri === uri && !isPaused;
return ( return (
<Page extraPadding> <Page extraPadding>
@ -170,7 +178,7 @@ class FilePage extends React.Component<Props> {
icon={icons.EDIT} icon={icons.EDIT}
label={__('Edit')} label={__('Edit')}
onClick={() => { onClick={() => {
prepareEdit(claim, uri); prepareEdit(claim, editUri);
navigate('/publish'); navigate('/publish');
}} }}
/> />

View file

@ -3,7 +3,7 @@ import * as ACTIONS from 'constants/action_types';
const getCurrentPath = () => { const getCurrentPath = () => {
const { hash } = document.location; const { hash } = document.location;
if (hash !== '') return hash.replace(/^#/, ''); if (hash !== '') return hash.replace(/^#/, '');
return '/discover'; return '/publish';
}; };
const reducers = {}; const reducers = {};