RC fixes #2473

Merged
neb-b merged 26 commits from fixes into master 2019-05-14 20:22:04 +02:00
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 6b0fd6d515 - Show all commits

View file

@ -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),
});

View file

@ -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;
kauffj commented 2019-05-14 00:22:52 +02:00 (Migrated from github.com)
Review

I believe you can have multiple supports in a single transaction. Should supports also be indexed by outpoint rather than txid?

I believe you can have multiple supports in a single transaction. Should supports also be indexed by outpoint rather than txid?
neb-b commented 2019-05-14 04:42:51 +02:00 (Migrated from github.com)
Review

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

~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) {
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}
/>
))}