channel list will no longer overwrite resolved claims byId #264

Merged
jessopb merged 1 commit from fix-channelListNoOverwrite into master 2020-01-22 15:27:45 +01:00
2 changed files with 8 additions and 3 deletions

4
dist/bundle.es.js vendored
View file

@ -4319,7 +4319,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];

View file

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