only navigate away from claim if abandoning
then i can still see other claims on that page
This commit is contained in:
parent
81fc2d596c
commit
62a6b73942
2 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doDeleteFileAndGoBack } from 'redux/actions/file';
|
||||
import { doDeleteFileAndMaybeGoBack } from 'redux/actions/file';
|
||||
import { makeSelectTitleForUri, makeSelectClaimIsMine, makeSelectFileInfoForUri } from 'lbry-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import ModalRemoveFile from './view';
|
||||
|
@ -13,7 +13,7 @@ const select = (state, props) => ({
|
|||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
deleteFile: (fileInfo, deleteFromComputer, abandonClaim) => {
|
||||
dispatch(doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim));
|
||||
dispatch(doDeleteFileAndMaybeGoBack(fileInfo, deleteFromComputer, abandonClaim));
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
selectFileInfosByOutpoint,
|
||||
} from 'lbry-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { goBack } from 'connected-react-router';
|
||||
|
||||
export function doOpenFileInFolder(path) {
|
||||
return () => {
|
||||
|
@ -58,11 +59,14 @@ export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) {
|
|||
};
|
||||
}
|
||||
|
||||
export function doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim) {
|
||||
export function doDeleteFileAndMaybeGoBack(fileInfo, deleteFromComputer, abandonClaim) {
|
||||
return dispatch => {
|
||||
const actions = [];
|
||||
actions.push(doHideModal());
|
||||
actions.push(doDeleteFile(fileInfo, deleteFromComputer, abandonClaim));
|
||||
dispatch(batchActions(...actions));
|
||||
if (abandonClaim) {
|
||||
dispatch(goBack());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue