Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix claim ID being null when reporting a claim that was not previously download. #1530

Merged
merged 3 commits into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/renderer/component/fileActions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const select = (state, props) => ({
/* availability check is disabled due to poor performance, TBD if it dies forever or requires daemon fix */
costInfo: makeSelectCostInfoForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
claimId: props.claimId,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is already being passed in from another component, we don't need to specify it here. This is only for selecting props from state.

});

const perform = dispatch => ({
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/component/fileActions/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type FileInfo = {

type Props = {
uri: string,
claimId: string,
openModal: ({ id: string }, { uri: string }) => void,
claimIsMine: boolean,
fileInfo: FileInfo,
Expand All @@ -19,9 +20,7 @@ type Props = {

class FileActions extends React.PureComponent<Props> {
render() {
const { fileInfo, uri, openModal, claimIsMine, vertical } = this.props;

const claimId = fileInfo ? fileInfo.claim_id : '';
const { fileInfo, uri, openModal, claimIsMine, vertical, claimId } = this.props;
const showDelete = fileInfo && Object.keys(fileInfo).length > 0;

return (
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/page/file/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ class FilePage extends React.Component<Props> {
<h1 className="card__title card__title--file">{title}</h1>
<div className="card__title-identity-icons">
<FilePrice uri={normalizeURI(uri)} />
{isRewardContent && <Icon iconColor="red" tooltip="bottom" icon={icons.FEATURED} />}
{isRewardContent && (
<Icon iconColor="red" tooltip="bottom" icon={icons.FEATURED} />
)}
</div>
</div>
<span className="card__subtitle card__subtitle--file">
Expand Down Expand Up @@ -216,7 +218,7 @@ class FilePage extends React.Component<Props> {

<div className="card__content">
<FileDownloadLink uri={uri} />
<FileActions uri={uri} />
<FileActions uri={uri} claimId={claim.claim_id} />
</div>

<div className="card__content--extra-padding">
Expand Down