RC fixes #2473
2 changed files with 12 additions and 5 deletions
|
@ -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),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
decided to do it now https://github.com/lbryio/lbry-redux/pull/145 ~Good point. Yeah, we probably should use it. Is this a blocker? RC testing has been using it. I can update after the release~
decided to do it now https://github.com/lbryio/lbry-redux/pull/145
|
|||||||
}
|
}
|
||||||
|
|
||||||
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}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Add table
Reference in a new issue
I believe you can have multiple supports in a single transaction. Should supports also be indexed by outpoint rather than txid?