allow unlocking supports

This commit is contained in:
Sean Yesmunt 2019-05-10 01:06:33 -04:00 committed by Thomas Zarebczan
parent 9d9976d77a
commit 7ce6bdb6a4
4 changed files with 10 additions and 12 deletions

View file

@ -117,7 +117,7 @@
"jsmediatags": "^3.8.1", "jsmediatags": "^3.8.1",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#c8126ab21792d7a85e1123a2363af285a0263654", "lbry-redux": "lbryio/lbry-redux#c2d02502387e404daca3dd9c62a0aa7c50814ea8",
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845", "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",

View file

@ -1,12 +1,12 @@
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 { selectAllMyClaimsByOutpoint, selectTransactionListFilter, doSetTransactionListFilter } from 'lbry-redux'; import { 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),
myClaims: selectAllMyClaimsByOutpoint(state), mySupports: selectSupportsById(state),
filterSetting: selectTransactionListFilter(state), filterSetting: selectTransactionListFilter(state),
}); });

View file

@ -14,7 +14,7 @@ type Props = {
transactions: Array<Transaction>, transactions: Array<Transaction>,
rewards: {}, rewards: {},
openModal: (id: string, { nout: number, txid: string }) => void, openModal: (id: string, { nout: number, txid: string }) => void,
myClaims: any, mySupports: {},
filterSetting: string, filterSetting: string,
setTransactionFilter: string => void, setTransactionFilter: string => void,
}; };
@ -41,11 +41,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, nout: number) { isRevokeable(txid: string) {
const { myClaims } = this.props; const { mySupports } = this.props;
// a claim/support/update is revokable if it return !!mySupports[txid];
// is in my claim list(claim_list_mine)
return myClaims.has(`${txid}:${nout}`);
} }
revokeClaim(txid: string, nout: number) { revokeClaim(txid: string, nout: number) {
@ -122,7 +120,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, t.nout)} isRevokeable={this.isRevokeable(t.txid)}
revokeClaim={this.revokeClaim} revokeClaim={this.revokeClaim}
/> />
))} ))}

View file

@ -6498,9 +6498,9 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
yargs "^13.2.2" yargs "^13.2.2"
zstd-codec "^0.1.1" zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#423123f1c19e61cead67c745d0892a2e4481cb6a: lbry-redux@lbryio/lbry-redux#c2d02502387e404daca3dd9c62a0aa7c50814ea8:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/423123f1c19e61cead67c745d0892a2e4481cb6a" resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/c2d02502387e404daca3dd9c62a0aa7c50814ea8"
dependencies: dependencies:
proxy-polyfill "0.1.6" proxy-polyfill "0.1.6"
reselect "^3.0.0" reselect "^3.0.0"