remove un-needed check to allow abandoning claims from file page

This commit is contained in:
Sean Yesmunt 2020-07-22 14:22:32 -04:00
parent b7e6412437
commit de3ae8e42e

View file

@ -2,14 +2,7 @@ import * as ACTIONS from 'constants/action_types';
// @if TARGET='app' // @if TARGET='app'
import { shell } from 'electron'; import { shell } from 'electron';
// @endif // @endif
import { import { Lbry, batchActions, doAbandonClaim, makeSelectFileInfoForUri, makeSelectClaimForUri } from 'lbry-redux';
Lbry,
batchActions,
doAbandonClaim,
selectMyClaimsOutpoints,
makeSelectFileInfoForUri,
makeSelectClaimForUri,
} from 'lbry-redux';
import { doHideModal } from 'redux/actions/app'; import { doHideModal } from 'redux/actions/app';
import { goBack } from 'connected-react-router'; import { goBack } from 'connected-react-router';
import { doSetPlayingUri } from 'redux/actions/content'; import { doSetPlayingUri } from 'redux/actions/content';
@ -31,16 +24,12 @@ export function doOpenFileInShell(path) {
} }
export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) { export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) {
return (dispatch, getState) => { return dispatch => {
const state = getState(); if (abandonClaim) {
// If the file is for a claim we published then also abandon the claim
const myClaimsOutpoints = selectMyClaimsOutpoints(state);
if (abandonClaim && myClaimsOutpoints.includes(outpoint)) {
const [txid, nout] = outpoint.split(':'); const [txid, nout] = outpoint.split(':');
dispatch(doAbandonClaim(txid, Number(nout))); dispatch(doAbandonClaim(txid, Number(nout)));
} }
// @if TARGET='app' // @if TARGET='app'
Lbry.file_delete({ Lbry.file_delete({
outpoint, outpoint,