diff --git a/ui/redux/reducers/claims.js b/ui/redux/reducers/claims.js index 2d6adc0c8..da63ef650 100644 --- a/ui/redux/reducers/claims.js +++ b/ui/redux/reducers/claims.js @@ -534,6 +534,7 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State = const newMyClaims = state.myClaims ? state.myClaims.slice() : []; const newMyChannelClaims = state.myChannelClaims ? state.myChannelClaims.slice() : []; const claimsByUri = Object.assign({}, state.claimsByUri); + const abandoningById = Object.assign({}, state.abandoningById); const newMyCollectionClaims = state.myCollectionClaims ? state.myCollectionClaims.slice() : []; Object.keys(claimsByUri).forEach((uri) => { @@ -541,6 +542,11 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State = delete claimsByUri[uri]; } }); + + if (abandoningById[claimId]) { + delete abandoningById[claimId]; + } + const myClaims = newMyClaims.filter((i) => i !== claimId); const myChannelClaims = newMyChannelClaims.filter((i) => i !== claimId); const myCollectionClaims = newMyCollectionClaims.filter((i) => i !== claimId); @@ -553,6 +559,7 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State = myCollectionClaims, byId, claimsByUri, + abandoningById, }); }; diff --git a/ui/redux/selectors/claims.js b/ui/redux/selectors/claims.js index 725a5c0cc..6cb544820 100644 --- a/ui/redux/selectors/claims.js +++ b/ui/redux/selectors/claims.js @@ -137,10 +137,7 @@ export const selectMyActiveClaims = createSelector( selectMyClaimsRaw, selectAbandoningIds, (claims, abandoningIds) => - new Set( - claims && - claims.map((claim) => claim.claim_id).filter((claimId) => Object.keys(abandoningIds).indexOf(claimId) === -1) - ) + new Set(claims && claims.map((claim) => claim.claim_id).filter((claimId) => !abandoningIds.includes(claimId))) ); export const makeSelectClaimIsMine = (rawUri: string) => {