channel list will no longer overwrite resolved claims byId (#264)
channel list will no longer overwrite resolved claims byId
This commit is contained in:
commit
7a1feea32a
2 changed files with 8 additions and 3 deletions
4
dist/bundle.es.js
vendored
4
dist/bundle.es.js
vendored
|
@ -4410,7 +4410,9 @@ reducers[FETCH_CHANNEL_LIST_COMPLETED] = (state, action) => {
|
||||||
claims.forEach(claim => {
|
claims.forEach(claim => {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
myChannelClaims.add(claim.claim_id);
|
myChannelClaims.add(claim.claim_id);
|
||||||
byId[claim.claim_id] = claim;
|
if (!byId[claim.claim_id]) {
|
||||||
|
byId[claim.claim_id] = claim;
|
||||||
|
}
|
||||||
|
|
||||||
if (pendingById[claim.claim_id] && claim.confirmations > 0) {
|
if (pendingById[claim.claim_id] && claim.confirmations > 0) {
|
||||||
delete pendingById[claim.claim_id];
|
delete pendingById[claim.claim_id];
|
||||||
|
|
|
@ -216,7 +216,9 @@ reducers[ACTIONS.FETCH_CHANNEL_LIST_COMPLETED] = (state: State, action: any): St
|
||||||
claims.forEach(claim => {
|
claims.forEach(claim => {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
myChannelClaims.add(claim.claim_id);
|
myChannelClaims.add(claim.claim_id);
|
||||||
byId[claim.claim_id] = claim;
|
if (!byId[claim.claim_id]) {
|
||||||
|
byId[claim.claim_id] = claim;
|
||||||
|
}
|
||||||
|
|
||||||
if (pendingById[claim.claim_id] && claim.confirmations > 0) {
|
if (pendingById[claim.claim_id] && claim.confirmations > 0) {
|
||||||
delete pendingById[claim.claim_id];
|
delete pendingById[claim.claim_id];
|
||||||
|
@ -265,7 +267,8 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = (state: State, action: any):
|
||||||
const paginatedClaimsByChannel = Object.assign({}, state.paginatedClaimsByChannel);
|
const paginatedClaimsByChannel = Object.assign({}, state.paginatedClaimsByChannel);
|
||||||
// check if count has changed - that means cached pagination will be wrong, so clear it
|
// check if count has changed - that means cached pagination will be wrong, so clear it
|
||||||
const previousCount = paginatedClaimsByChannel[uri] && paginatedClaimsByChannel[uri]['itemCount'];
|
const previousCount = paginatedClaimsByChannel[uri] && paginatedClaimsByChannel[uri]['itemCount'];
|
||||||
const byChannel = (claimsInChannel === previousCount) ? Object.assign({}, paginatedClaimsByChannel[uri]) : {};
|
const byChannel =
|
||||||
|
claimsInChannel === previousCount ? Object.assign({}, paginatedClaimsByChannel[uri]) : {};
|
||||||
const allClaimIds = new Set(byChannel.all);
|
const allClaimIds = new Set(byChannel.all);
|
||||||
const currentPageClaimIds = [];
|
const currentPageClaimIds = [];
|
||||||
const byId = Object.assign({}, state.byId);
|
const byId = Object.assign({}, state.byId);
|
||||||
|
|
Loading…
Reference in a new issue