Fix repost deletion
This commit is contained in:
parent
97762fdd24
commit
360f64e71f
4 changed files with 17 additions and 5 deletions
|
@ -97,7 +97,7 @@ function ClaimMenuList(props: Props) {
|
|||
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
|
||||
const subscriptionLabel = isSubscribed ? __('Unfollow') : __('Follow');
|
||||
|
||||
const { push, replace } = useHistory();
|
||||
const { push } = useHistory();
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ function ClaimMenuList(props: Props) {
|
|||
if (!isRepost && !isChannel) {
|
||||
openModal(MODALS.CONFIRM_FILE_REMOVE, { uri });
|
||||
} else {
|
||||
openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: !isRepost && (() => replace(`/$/${PAGES.CHANNELS}`)) });
|
||||
openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,11 @@ function RepostCreate(props: Props) {
|
|||
}).then((repostClaim: StreamClaim) => {
|
||||
doCheckPendingClaims();
|
||||
analytics.apiLogPublish(repostClaim);
|
||||
doToast({ message: __('Woohoo! Successfully reposted this claim.') });
|
||||
doToast({
|
||||
message: __('Woohoo! Successfully reposted this claim.'),
|
||||
linkText: __('Uploads'),
|
||||
linkTarget: '/uploads',
|
||||
});
|
||||
replace(getRedirect(contentUri, uri, redirectUri));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { doAbandonTxo, doAbandonClaim, selectTransactionItems } from 'lbry-redux';
|
||||
import { doAbandonTxo, doAbandonClaim, selectTransactionItems, doResolveUri } from 'lbry-redux';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import ModalRevokeClaim from './view';
|
||||
|
||||
|
@ -13,6 +13,7 @@ const perform = dispatch => ({
|
|||
closeModal: () => dispatch(doHideModal()),
|
||||
abandonTxo: (txo, cb) => dispatch(doAbandonTxo(txo, cb)),
|
||||
abandonClaim: (txid, nout, cb) => dispatch(doAbandonClaim(txid, nout, cb)),
|
||||
doResolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ModalRevokeClaim);
|
||||
|
|
|
@ -15,13 +15,20 @@ type Props = {
|
|||
tx: Txo,
|
||||
claim: GenericClaim,
|
||||
cb: () => void,
|
||||
doResolveUri: (string) => void,
|
||||
};
|
||||
|
||||
export default function ModalRevokeClaim(props: Props) {
|
||||
const { tx, claim, closeModal, abandonTxo, abandonClaim, cb } = props;
|
||||
const { tx, claim, closeModal, abandonTxo, abandonClaim, cb, doResolveUri } = props;
|
||||
const { value_type: valueType, type, normalized_name: name, is_my_input: isSupport } = tx || claim;
|
||||
const [channelName, setChannelName] = useState('');
|
||||
|
||||
React.useEffect(() => {
|
||||
if (claim) {
|
||||
doResolveUri(claim.permanent_url);
|
||||
}
|
||||
}, [claim, doResolveUri]);
|
||||
|
||||
const shouldConfirmChannel =
|
||||
valueType === txnTypes.CHANNEL || type === txnTypes.CHANNEL || (type === txnTypes.UPDATE && name.startsWith('@'));
|
||||
|
||||
|
|
Loading…
Reference in a new issue