save channel claim data to claimsByUri
This commit is contained in:
parent
177ef2c191
commit
ee70170e30
2 changed files with 8 additions and 2 deletions
7
dist/bundle.js
vendored
7
dist/bundle.js
vendored
|
@ -3080,7 +3080,7 @@ var selectMyChannelClaims = exports.selectMyChannelClaims = (0, _reselect.create
|
||||||
|
|
||||||
ids.forEach(function (id) {
|
ids.forEach(function (id) {
|
||||||
if (byId[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]);
|
claims.push(byId[id]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4970,12 +4970,14 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = function (state, action) {
|
||||||
var currentPageClaimIds = [];
|
var currentPageClaimIds = [];
|
||||||
var byId = Object.assign({}, state.byId);
|
var byId = Object.assign({}, state.byId);
|
||||||
var fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);
|
var fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);
|
||||||
|
var claimsByUri = Object.assign({}, state.claimsByUri);
|
||||||
|
|
||||||
if (claims !== undefined) {
|
if (claims !== undefined) {
|
||||||
claims.forEach(function (claim) {
|
claims.forEach(function (claim) {
|
||||||
allClaimIds.add(claim.claim_id);
|
allClaimIds.add(claim.claim_id);
|
||||||
currentPageClaimIds.push(claim.claim_id);
|
currentPageClaimIds.push(claim.claim_id);
|
||||||
byId[claim.claim_id] = claim;
|
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, {
|
return Object.assign({}, state, {
|
||||||
claimsByChannel: claimsByChannel,
|
claimsByChannel: claimsByChannel,
|
||||||
byId: byId,
|
byId: byId,
|
||||||
fetchingChannelClaims: fetchingChannelClaims
|
fetchingChannelClaims: fetchingChannelClaims,
|
||||||
|
claimsByUri: claimsByUri
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -127,12 +127,14 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = (state, action) => {
|
||||||
const currentPageClaimIds = [];
|
const currentPageClaimIds = [];
|
||||||
const byId = Object.assign({}, state.byId);
|
const byId = Object.assign({}, state.byId);
|
||||||
const fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);
|
const fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);
|
||||||
|
const claimsByUri = Object.assign({}, state.claimsByUri);
|
||||||
|
|
||||||
if (claims !== undefined) {
|
if (claims !== undefined) {
|
||||||
claims.forEach(claim => {
|
claims.forEach(claim => {
|
||||||
allClaimIds.add(claim.claim_id);
|
allClaimIds.add(claim.claim_id);
|
||||||
currentPageClaimIds.push(claim.claim_id);
|
currentPageClaimIds.push(claim.claim_id);
|
||||||
byId[claim.claim_id] = claim;
|
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,
|
claimsByChannel,
|
||||||
byId,
|
byId,
|
||||||
fetchingChannelClaims,
|
fetchingChannelClaims,
|
||||||
|
claimsByUri,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue