mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-13 22:09:47 +00:00
remove un-needed check to allow abandoning claims from file page
This commit is contained in:
parent
b7e6412437
commit
de3ae8e42e
1 changed files with 5 additions and 16 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue