channel list will no longer overwrite resolved claims byId (#264)

channel list will no longer overwrite resolved claims byId
This commit is contained in:
Sean Yesmunt 2020-01-22 09:27:44 -05:00 committed by GitHub
commit 7a1feea32a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

4
dist/bundle.es.js vendored
View file

@ -4410,7 +4410,9 @@ reducers[FETCH_CHANNEL_LIST_COMPLETED] = (state, action) => {
claims.forEach(claim => {
// $FlowFixMe
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) {
delete pendingById[claim.claim_id];

View file

@ -216,7 +216,9 @@ reducers[ACTIONS.FETCH_CHANNEL_LIST_COMPLETED] = (state: State, action: any): St
claims.forEach(claim => {
// $FlowFixMe
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) {
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);
// check if count has changed - that means cached pagination will be wrong, so clear it
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 currentPageClaimIds = [];
const byId = Object.assign({}, state.byId);