Merge pull request #3642 from lbryio/fix-goBackAfterDelete

navigate back after delete if abandoned
This commit is contained in:
jessopb 2020-02-06 14:48:45 -05:00 committed by GitHub
commit 5a38c5081f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -923,6 +923,7 @@
"refreshing the app": "refreshing the app",
"Follower": "Follower",
"%repost_channel_link% reposted": "%repost_channel_link% reposted",
"Abandon on blockchain (reclaim %amount% LBC)": "Abandon on blockchain (reclaim %amount% LBC)",
"This channel may have been unpublished.": "This channel may have been unpublished.",
"There was an error. Try %refreshing_the_app_link% to fix it. If that doesn't work, try pressing Ctrl+R/Cmd+R.": "There was an error. Try %refreshing_the_app_link% to fix it. If that doesn't work, try pressing Ctrl+R/Cmd+R."
}
}

View file

@ -63,7 +63,6 @@ export function doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim
const { outpoint } = makeSelectFileInfoForUri(uri)(state) || '';
const { nout, txid } = makeSelectClaimForUri(uri)(state);
const claimOutpoint = `${txid}:${nout}`;
const actions = [];
actions.push(doHideModal());
actions.push(doDeleteFile(outpoint || claimOutpoint, deleteFromComputer, abandonClaim));
@ -71,13 +70,12 @@ export function doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim
if (playingUri === uri) {
actions.push(doSetPlayingUri(null));
}
// it would be nice to stay on the claim if you just want to delete it
// we need to alter autoplay to not start downloading again after you delete it
// if (abandonClaim) {
actions.push(goBack());
// }
dispatch(batchActions(...actions));
if (abandonClaim) {
dispatch(goBack());
}
};
}