fix: show claim actions too

Conflicts:
	package.json
	yarn.lock
This commit is contained in:
Thomas Zarebczan 2019-05-10 03:24:35 -04:00
parent 2e98283d52
commit 6b0fd6d515
2 changed files with 12 additions and 5 deletions

View file

@ -1,12 +1,18 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { selectClaimedRewardsByTransactionId } from 'lbryinc'; import { selectClaimedRewardsByTransactionId } from 'lbryinc';
import { doOpenModal } from 'redux/actions/app'; 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'; import TransactionList from './view';
const select = state => ({ const select = state => ({
rewards: selectClaimedRewardsByTransactionId(state), rewards: selectClaimedRewardsByTransactionId(state),
mySupports: selectSupportsById(state), mySupports: selectSupportsById(state),
myClaims: selectAllMyClaimsByOutpoint(state),
filterSetting: selectTransactionListFilter(state), filterSetting: selectTransactionListFilter(state),
}); });

View file

@ -15,6 +15,7 @@ type Props = {
rewards: {}, rewards: {},
openModal: (id: string, { nout: number, txid: string }) => void, openModal: (id: string, { nout: number, txid: string }) => void,
mySupports: {}, mySupports: {},
myClaims: any,
filterSetting: string, filterSetting: string,
setTransactionFilter: string => void, setTransactionFilter: string => void,
}; };
@ -41,9 +42,9 @@ class TransactionList extends React.PureComponent<Props> {
return this.props.filterSetting === TRANSACTIONS.ALL || this.props.filterSetting === transaction.type; return this.props.filterSetting === TRANSACTIONS.ALL || this.props.filterSetting === transaction.type;
} }
isRevokeable(txid: string) { isRevokeable(txid: string, nout: number) {
const { mySupports } = this.props; const { mySupports, myClaims } = this.props;
return !!mySupports[txid]; return !!mySupports[txid] || myClaims.has(`${txid}:${nout}`);
} }
revokeClaim(txid: string, nout: number) { revokeClaim(txid: string, nout: number) {
@ -120,7 +121,7 @@ class TransactionList extends React.PureComponent<Props> {
key={`${t.txid}:${t.nout}`} key={`${t.txid}:${t.nout}`}
transaction={t} transaction={t}
reward={rewards && rewards[t.txid]} reward={rewards && rewards[t.txid]}
isRevokeable={this.isRevokeable(t.txid)} isRevokeable={this.isRevokeable(t.txid, t.nout)}
revokeClaim={this.revokeClaim} revokeClaim={this.revokeClaim}
/> />
))} ))}