Merge pull request #41 from lbryio/autoclaim-rewards
auto claim eligible rewards after viewing a file
This commit is contained in:
commit
9e8ba95fec
2 changed files with 6 additions and 1 deletions
|
@ -25,6 +25,7 @@ import {
|
|||
selectPurchaseUriErrorMessage,
|
||||
} from 'lbry-redux';
|
||||
import {
|
||||
doClaimEligiblePurchaseRewards,
|
||||
doFetchCostInfoForUri,
|
||||
makeSelectCostInfoForUri,
|
||||
selectRewardContentClaimIds,
|
||||
|
@ -69,6 +70,7 @@ const select = (state, props) => {
|
|||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
claimEligibleRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
||||
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
||||
},
|
||||
|
|
|
@ -477,6 +477,7 @@ class FilePage extends React.PureComponent {
|
|||
return;
|
||||
}
|
||||
|
||||
const { claimEligibleRewards } = this.props;
|
||||
const { nout, claim_id: claimId, txid } = claim;
|
||||
const outpoint = `${txid}:${nout}`;
|
||||
const params = {
|
||||
|
@ -488,7 +489,9 @@ class FilePage extends React.PureComponent {
|
|||
params.time_to_start = timeToStart;
|
||||
}
|
||||
|
||||
Lbryio.call('file', 'view', params).catch(() => {});
|
||||
Lbryio.call('file', 'view', params)
|
||||
.then(() => claimEligibleRewards())
|
||||
.catch(() => {});
|
||||
this.setState({ fileViewLogged: true });
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue