disable edits while pending
This commit is contained in:
parent
6d8fce6011
commit
7667c98cf0
3 changed files with 8 additions and 3 deletions
|
@ -15,6 +15,7 @@ import {
|
|||
doCollectionEdit,
|
||||
makeSelectUrlsForCollectionId,
|
||||
makeSelectIndexForUrlInCollection,
|
||||
makeSelectClaimIdIsPending,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels, makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
|
@ -47,6 +48,7 @@ const select = (state, props) => ({
|
|||
isCollectionMine: makeSelectCollectionIsMine(props.collectionId)(state),
|
||||
collectionUris: makeSelectUrlsForCollectionId(props.collectionId)(state),
|
||||
collectionIndex: makeSelectIndexForUrlInCollection(props.uri, props.collectionId)(state),
|
||||
collectionIsPending: makeSelectClaimIdIsPending(props.collectionId)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
|
|
@ -79,6 +79,7 @@ type Props = {
|
|||
collectionUris: Array<Collection>,
|
||||
collectionIndex?: number,
|
||||
disableNavigation?: boolean,
|
||||
collectionIsPending?: boolean,
|
||||
};
|
||||
|
||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
|
@ -135,6 +136,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
editCollection,
|
||||
isCollectionMine,
|
||||
collectionUris,
|
||||
collectionIsPending,
|
||||
disableNavigation,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
|
@ -346,7 +348,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
<Button
|
||||
button="alt"
|
||||
className={'button-collection-order'}
|
||||
disabled={collectionIndex === 0}
|
||||
disabled={collectionIndex === 0 || collectionIsPending}
|
||||
icon={ICONS.UP}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
@ -363,7 +365,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
button="alt"
|
||||
className={'button-collection-order'}
|
||||
icon={ICONS.DOWN}
|
||||
disabled={collectionIndex === lastCollectionIndex}
|
||||
disabled={collectionIndex === lastCollectionIndex || collectionIsPending}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
@ -379,6 +381,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
<div className="collection-preview__edit-group">
|
||||
<Button
|
||||
button="alt"
|
||||
disabled={collectionIsPending}
|
||||
icon={ICONS.DELETE}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -81,7 +81,7 @@ export default function CollectionPage(props: Props) {
|
|||
const pending = (
|
||||
<div className="help card__title--help">
|
||||
<Spinner type={'small'} />
|
||||
{__('Your publish is being confirmed and will be live soon')}
|
||||
{__('Please wait for confirmation before making further changes')}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue