add and use editClaim action
This commit is contained in:
parent
7766b6db28
commit
72d98767c6
3 changed files with 12 additions and 9 deletions
|
@ -13,7 +13,7 @@ import {
|
|||
selectTotalDownloadProgress,
|
||||
} from "selectors/file_info";
|
||||
import { doCloseModal } from "actions/app";
|
||||
import { doHistoryBack } from "actions/navigation";
|
||||
import { doNavigate, doHistoryBack } from "actions/navigation";
|
||||
import setProgressBar from "util/setProgressBar";
|
||||
import batchActions from "util/batchActions";
|
||||
|
||||
|
@ -155,3 +155,9 @@ export function doFetchFileInfosAndPublishedClaims() {
|
|||
if (!isFetchingFileInfo) dispatch(doFileList());
|
||||
};
|
||||
}
|
||||
|
||||
export function doEditClaim(fileInfo) {
|
||||
return function(dispatch, getState) {
|
||||
dispatch(doNavigate("/publish", fileInfo));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,13 +9,9 @@ import {
|
|||
import { makeSelectIsAvailableForUri } from "selectors/availability";
|
||||
import { makeSelectCostInfoForUri } from "selectors/cost_info";
|
||||
import { doCloseModal, doOpenModal } from "actions/app";
|
||||
import { doNavigate } from "actions/navigation";
|
||||
import { doFetchAvailability } from "actions/availability";
|
||||
import { doOpenFileInShell, doOpenFileInFolder } from "actions/file_info";
|
||||
import {
|
||||
makeSelectClaimForUriIsMine,
|
||||
makeSelectClaimForUri,
|
||||
} from "selectors/claims";
|
||||
import { doOpenFileInShell, doOpenFileInFolder, doEditClaim, } from "actions/file_info";
|
||||
import { makeSelectClaimForUri,makeSelectClaimForUriIsMine } from "selectors/claims";
|
||||
import { doPurchaseUri, doLoadVideo, doStartDownload } from "actions/content";
|
||||
import FileActions from "./view";
|
||||
|
||||
|
@ -53,7 +49,7 @@ const perform = dispatch => ({
|
|||
startDownload: uri => dispatch(doPurchaseUri(uri, "affirmPurchase")),
|
||||
loadVideo: uri => dispatch(doLoadVideo(uri)),
|
||||
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)),
|
||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||
editClaim: fileInfo => dispatch(doEditClaim(fileInfo)),
|
||||
});
|
||||
|
||||
export default connect(makeSelect, perform)(FileActions);
|
||||
|
|
|
@ -79,6 +79,7 @@ class FileActions extends React.PureComponent {
|
|||
claimIsMine,
|
||||
claimInfo,
|
||||
navigate,
|
||||
editClaim,
|
||||
} = this.props;
|
||||
|
||||
const name = fileInfo ? fileInfo.name : null;
|
||||
|
@ -192,7 +193,7 @@ class FileActions extends React.PureComponent {
|
|||
{claimIsMine &&
|
||||
<DropDownMenuItem
|
||||
key={1}
|
||||
onClick={() => navigate("/publish", { name, channel })}
|
||||
onClick={() => editClaim({ name, channel })}
|
||||
label={__("Edit claim")}
|
||||
/>}
|
||||
<DropDownMenuItem
|
||||
|
|
Loading…
Add table
Reference in a new issue