add default value

This commit is contained in:
Sean Yesmunt 2018-10-26 18:40:53 -04:00
parent 2375860d62
commit a16815c255
2 changed files with 11 additions and 11 deletions
dist
src/redux/selectors

10
dist/bundle.js vendored
View file

@ -3086,11 +3086,11 @@ var selectAllClaimsByChannel = exports.selectAllClaimsByChannel = (0, _reselect.
}); });
var selectPendingById = exports.selectPendingById = (0, _reselect.createSelector)(selectState, function (state) { var selectPendingById = exports.selectPendingById = (0, _reselect.createSelector)(selectState, function (state) {
return state.pendingById; return state.pendingById || {};
}); });
var selectPendingClaims = exports.selectPendingClaims = (0, _reselect.createSelector)(selectState, function (state) { var selectPendingClaims = exports.selectPendingClaims = (0, _reselect.createSelector)(selectState, function (state) {
return Object.values(state.pendingById || {}); return Object.values(state.pendingById || []);
}); });
var makeSelectClaimIsPending = exports.makeSelectClaimIsPending = function makeSelectClaimIsPending(uri) { var makeSelectClaimIsPending = exports.makeSelectClaimIsPending = function makeSelectClaimIsPending(uri) {
@ -5226,14 +5226,14 @@ reducers[ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED] = function (state, action) {
var byId = Object.assign({}, state.byId); var byId = Object.assign({}, state.byId);
var pendingById = Object.assign({}, state.pendingById); var pendingById = Object.assign({}, state.pendingById);
claims.filter(function (claim) { claims.forEach(function (claim) {
return claim.type && claim.type.match(/claim|update/); if (claim.type && claim.type.match(/claim|update/)) {
}).forEach(function (claim) {
if (claim.confirmations < 1) { if (claim.confirmations < 1) {
pendingById[claim.claim_id] = claim; pendingById[claim.claim_id] = claim;
} else { } else {
byId[claim.claim_id] = claim; byId[claim.claim_id] = claim;
} }
}
}); });
// Remove old pending publishes // Remove old pending publishes

View file

@ -33,10 +33,10 @@ export const selectAllClaimsByChannel = createSelector(
(state) => state.claimsByChannel || {} (state) => state.claimsByChannel || {}
); );
export const selectPendingById = createSelector(selectState, (state) => state.pendingById); export const selectPendingById = createSelector(selectState, (state) => state.pendingById || {});
export const selectPendingClaims = createSelector(selectState, (state) => export const selectPendingClaims = createSelector(selectState, (state) =>
Object.values(state.pendingById || {}) Object.values(state.pendingById || [])
); );
export const makeSelectClaimIsPending = (uri) => export const makeSelectClaimIsPending = (uri) =>