From 62a6b739428e17d9c3c8592f24563388f01ce660 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 19 Apr 2019 12:55:21 -0400 Subject: [PATCH] only navigate away from claim if abandoning then i can still see other claims on that page --- src/ui/modal/modalRemoveFile/index.js | 4 ++-- src/ui/redux/actions/file.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ui/modal/modalRemoveFile/index.js b/src/ui/modal/modalRemoveFile/index.js index 9b44ce8d0..59d0cdb70 100644 --- a/src/ui/modal/modalRemoveFile/index.js +++ b/src/ui/modal/modalRemoveFile/index.js @@ -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)); }, }); diff --git a/src/ui/redux/actions/file.js b/src/ui/redux/actions/file.js index fee8cb114..4fba2425d 100644 --- a/src/ui/redux/actions/file.js +++ b/src/ui/redux/actions/file.js @@ -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()); + } }; }