diff --git a/src/ui/redux/actions/file.js b/src/ui/redux/actions/file.js index 44048742a..2842b16ac 100644 --- a/src/ui/redux/actions/file.js +++ b/src/ui/redux/actions/file.js @@ -2,7 +2,14 @@ import * as ACTIONS from 'constants/action_types'; // @if TARGET='app' import { shell } from 'electron'; // @endif -import { Lbry, batchActions, doAbandonClaim, selectMyClaimsOutpoints, makeSelectFileInfoForUri } from 'lbry-redux'; +import { + Lbry, + batchActions, + doAbandonClaim, + selectMyClaimsOutpoints, + makeSelectFileInfoForUri, + makeSelectClaimForUri, +} from 'lbry-redux'; import { doHideModal } from 'redux/actions/app'; import { goBack } from 'connected-react-router'; import { doSetPlayingUri } from 'redux/actions/content'; @@ -54,9 +61,12 @@ export function doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim const state = getState(); const playingUri = selectPlayingUri(state); const { outpoint } = makeSelectFileInfoForUri(uri)(state) || ''; + const { nout, txid } = makeSelectClaimForUri(uri)(state); + const claimOutpoint = `${txid}:${nout}`; + const actions = []; actions.push(doHideModal()); - actions.push(doDeleteFile(outpoint, deleteFromComputer, abandonClaim)); + actions.push(doDeleteFile(outpoint || claimOutpoint, deleteFromComputer, abandonClaim)); if (playingUri === uri) { actions.push(doSetPlayingUri(null));