save channel claim data to claimsByUri

This commit is contained in:
Travis Eden 2018-07-18 15:13:50 -04:00
parent 177ef2c191
commit ee70170e30
2 changed files with 8 additions and 2 deletions

7
dist/bundle.js vendored
View file

@ -3080,7 +3080,7 @@ var selectMyChannelClaims = exports.selectMyChannelClaims = (0, _reselect.create
ids.forEach(function (id) {
if (byId[id]) {
// I'm not sure why this check is necessary, but it ought to be a quick fix for https://github.com/lbryio/lbry-app/issues/544
// I'm not sure why this check is necessary, but it ought to be a quick fix for https://github.com/lbryio/lbry-desktop/issues/544
claims.push(byId[id]);
}
});
@ -4970,12 +4970,14 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = function (state, action) {
var currentPageClaimIds = [];
var byId = Object.assign({}, state.byId);
var fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);
var claimsByUri = Object.assign({}, state.claimsByUri);
if (claims !== undefined) {
claims.forEach(function (claim) {
allClaimIds.add(claim.claim_id);
currentPageClaimIds.push(claim.claim_id);
byId[claim.claim_id] = claim;
claimsByUri['lbry://' + claim.name + '#' + claim.claim_id] = claim.claim_id;
});
}
@ -4987,7 +4989,8 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = function (state, action) {
return Object.assign({}, state, {
claimsByChannel: claimsByChannel,
byId: byId,
fetchingChannelClaims: fetchingChannelClaims
fetchingChannelClaims: fetchingChannelClaims,
claimsByUri: claimsByUri
});
};

View file

@ -127,12 +127,14 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = (state, action) => {
const currentPageClaimIds = [];
const byId = Object.assign({}, state.byId);
const fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);
const claimsByUri = Object.assign({}, state.claimsByUri);
if (claims !== undefined) {
claims.forEach(claim => {
allClaimIds.add(claim.claim_id);
currentPageClaimIds.push(claim.claim_id);
byId[claim.claim_id] = claim;
claimsByUri[`lbry://${claim.name}#${claim.claim_id}`] = claim.claim_id;
});
}
@ -145,6 +147,7 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = (state, action) => {
claimsByChannel,
byId,
fetchingChannelClaims,
claimsByUri,
});
};