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

18
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) {
return state.pendingById;
return state.pendingById || {};
});
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) {
@ -5226,13 +5226,13 @@ reducers[ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED] = function (state, action) {
var byId = Object.assign({}, state.byId);
var pendingById = Object.assign({}, state.pendingById);
claims.filter(function (claim) {
return claim.type && claim.type.match(/claim|update/);
}).forEach(function (claim) {
if (claim.confirmations < 1) {
pendingById[claim.claim_id] = claim;
} else {
byId[claim.claim_id] = claim;
claims.forEach(function (claim) {
if (claim.type && claim.type.match(/claim|update/)) {
if (claim.confirmations < 1) {
pendingById[claim.claim_id] = claim;
} else {
byId[claim.claim_id] = claim;
}
}
});

View file

@ -33,10 +33,10 @@ export const selectAllClaimsByChannel = createSelector(
(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) =>
Object.values(state.pendingById || {})
Object.values(state.pendingById || [])
);
export const makeSelectClaimIsPending = (uri) =>