fix: show claim actions too
Conflicts: package.json yarn.lock
This commit is contained in:
parent
2e98283d52
commit
6b0fd6d515
2 changed files with 12 additions and 5 deletions
|
@ -1,12 +1,18 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectClaimedRewardsByTransactionId } from 'lbryinc';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { selectSupportsById, selectTransactionListFilter, doSetTransactionListFilter } from 'lbry-redux';
|
||||
import {
|
||||
selectAllMyClaimsByOutpoint,
|
||||
selectSupportsById,
|
||||
selectTransactionListFilter,
|
||||
doSetTransactionListFilter,
|
||||
} from 'lbry-redux';
|
||||
import TransactionList from './view';
|
||||
|
||||
const select = state => ({
|
||||
rewards: selectClaimedRewardsByTransactionId(state),
|
||||
mySupports: selectSupportsById(state),
|
||||
myClaims: selectAllMyClaimsByOutpoint(state),
|
||||
filterSetting: selectTransactionListFilter(state),
|
||||
});
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ type Props = {
|
|||
rewards: {},
|
||||
openModal: (id: string, { nout: number, txid: string }) => void,
|
||||
mySupports: {},
|
||||
myClaims: any,
|
||||
filterSetting: string,
|
||||
setTransactionFilter: string => void,
|
||||
};
|
||||
|
@ -41,9 +42,9 @@ class TransactionList extends React.PureComponent<Props> {
|
|||
return this.props.filterSetting === TRANSACTIONS.ALL || this.props.filterSetting === transaction.type;
|
||||
}
|
||||
|
||||
isRevokeable(txid: string) {
|
||||
const { mySupports } = this.props;
|
||||
return !!mySupports[txid];
|
||||
isRevokeable(txid: string, nout: number) {
|
||||
const { mySupports, myClaims } = this.props;
|
||||
return !!mySupports[txid] || myClaims.has(`${txid}:${nout}`);
|
||||
}
|
||||
|
||||
revokeClaim(txid: string, nout: number) {
|
||||
|
@ -120,7 +121,7 @@ class TransactionList extends React.PureComponent<Props> {
|
|||
key={`${t.txid}:${t.nout}`}
|
||||
transaction={t}
|
||||
reward={rewards && rewards[t.txid]}
|
||||
isRevokeable={this.isRevokeable(t.txid)}
|
||||
isRevokeable={this.isRevokeable(t.txid, t.nout)}
|
||||
revokeClaim={this.revokeClaim}
|
||||
/>
|
||||
))}
|
||||
|
|
Loading…
Add table
Reference in a new issue