mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
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 showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
|
||||||
const subscriptionLabel = isSubscribed ? __('Unfollow') : __('Follow');
|
const subscriptionLabel = isSubscribed ? __('Unfollow') : __('Follow');
|
||||||
|
|
||||||
const { push, replace } = useHistory();
|
const { push } = useHistory();
|
||||||
if (!claim) {
|
if (!claim) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ function ClaimMenuList(props: Props) {
|
||||||
if (!isRepost && !isChannel) {
|
if (!isRepost && !isChannel) {
|
||||||
openModal(MODALS.CONFIRM_FILE_REMOVE, { uri });
|
openModal(MODALS.CONFIRM_FILE_REMOVE, { uri });
|
||||||
} else {
|
} 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) => {
|
}).then((repostClaim: StreamClaim) => {
|
||||||
doCheckPendingClaims();
|
doCheckPendingClaims();
|
||||||
analytics.apiLogPublish(repostClaim);
|
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));
|
replace(getRedirect(contentUri, uri, redirectUri));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doHideModal } from 'redux/actions/app';
|
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 { doToast } from 'redux/actions/notifications';
|
||||||
import ModalRevokeClaim from './view';
|
import ModalRevokeClaim from './view';
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doHideModal()),
|
closeModal: () => dispatch(doHideModal()),
|
||||||
abandonTxo: (txo, cb) => dispatch(doAbandonTxo(txo, cb)),
|
abandonTxo: (txo, cb) => dispatch(doAbandonTxo(txo, cb)),
|
||||||
abandonClaim: (txid, nout, cb) => dispatch(doAbandonClaim(txid, nout, cb)),
|
abandonClaim: (txid, nout, cb) => dispatch(doAbandonClaim(txid, nout, cb)),
|
||||||
|
doResolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(ModalRevokeClaim);
|
export default connect(select, perform)(ModalRevokeClaim);
|
||||||
|
|
|
@ -15,13 +15,20 @@ type Props = {
|
||||||
tx: Txo,
|
tx: Txo,
|
||||||
claim: GenericClaim,
|
claim: GenericClaim,
|
||||||
cb: () => void,
|
cb: () => void,
|
||||||
|
doResolveUri: (string) => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function ModalRevokeClaim(props: Props) {
|
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 { value_type: valueType, type, normalized_name: name, is_my_input: isSupport } = tx || claim;
|
||||||
const [channelName, setChannelName] = useState('');
|
const [channelName, setChannelName] = useState('');
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (claim) {
|
||||||
|
doResolveUri(claim.permanent_url);
|
||||||
|
}
|
||||||
|
}, [claim, doResolveUri]);
|
||||||
|
|
||||||
const shouldConfirmChannel =
|
const shouldConfirmChannel =
|
||||||
valueType === txnTypes.CHANNEL || type === txnTypes.CHANNEL || (type === txnTypes.UPDATE && name.startsWith('@'));
|
valueType === txnTypes.CHANNEL || type === txnTypes.CHANNEL || (type === txnTypes.UPDATE && name.startsWith('@'));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue