From 6217edccf7cb94a8f228565a253971e453ebc076 Mon Sep 17 00:00:00 2001 From: jessop Date: Mon, 17 Aug 2020 15:54:03 -0400 Subject: [PATCH] bugfix --- dist/bundle.es.js | 8 ++++---- dist/bundle.js | 8 ++++---- src/redux/selectors/blacklist.js | 20 ++++++++++++-------- src/redux/selectors/filtered.js | 20 ++++++++++++-------- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index f60ae6c..8f87b96 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1464,21 +1464,21 @@ const makeSelectFetchingCostInfoForUri = uri => reselect.createSelector(selectFe const selectState$2 = state => state.blacklist || {}; const selectBlackListedOutpoints = reselect.createSelector(selectState$2, state => state.blackListedOutpoints); -const selectBlacklistedOutpointMap = reselect.createSelector(selectBlackListedOutpoints, outpoints => outpoints.reduce((acc, val) => { +const selectBlacklistedOutpointMap = reselect.createSelector(selectBlackListedOutpoints, outpoints => outpoints ? outpoints.reduce((acc, val) => { const outpoint = `${val.txid}:${val.nout}`; return { ...acc, [outpoint]: 1 }; -}, {})); +}, {}) : {}); const selectState$3 = state => state.filtered || {}; const selectFilteredOutpoints = reselect.createSelector(selectState$3, state => state.filteredOutpoints); -const selectFilteredOutpointMap = reselect.createSelector(selectFilteredOutpoints, outpoints => outpoints.reduce((acc, val) => { +const selectFilteredOutpointMap = reselect.createSelector(selectFilteredOutpoints, outpoints => outpoints ? outpoints.reduce((acc, val) => { const outpoint = `${val.txid}:${val.nout}`; return { ...acc, [outpoint]: 1 }; -}, {})); +}, {}) : {}); const selectState$4 = state => state.homepage || {}; diff --git a/dist/bundle.js b/dist/bundle.js index e6804bf..4ad0136 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -4556,10 +4556,10 @@ var selectBlackListedOutpoints = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["c return state.blackListedOutpoints; }); var selectBlacklistedOutpointMap = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectBlackListedOutpoints, function (outpoints) { - return outpoints.reduce(function (acc, val) { + return outpoints ? outpoints.reduce(function (acc, val) { var outpoint = "".concat(val.txid, ":").concat(val.nout); return _objectSpread({}, acc, _defineProperty({}, outpoint, 1)); - }, {}); + }, {}) : {}; }); /***/ }), @@ -4585,10 +4585,10 @@ var selectFilteredOutpoints = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["crea return state.filteredOutpoints; }); var selectFilteredOutpointMap = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectFilteredOutpoints, function (outpoints) { - return outpoints.reduce(function (acc, val) { + return outpoints ? outpoints.reduce(function (acc, val) { var outpoint = "".concat(val.txid, ":").concat(val.nout); return _objectSpread({}, acc, _defineProperty({}, outpoint, 1)); - }, {}); + }, {}) : {}; }); /***/ }), diff --git a/src/redux/selectors/blacklist.js b/src/redux/selectors/blacklist.js index bef7721..152bb87 100644 --- a/src/redux/selectors/blacklist.js +++ b/src/redux/selectors/blacklist.js @@ -7,12 +7,16 @@ export const selectBlackListedOutpoints = createSelector( state => state.blackListedOutpoints ); -export const selectBlacklistedOutpointMap = createSelector(selectBlackListedOutpoints, outpoints => - outpoints.reduce((acc, val) => { - const outpoint = `${val.txid}:${val.nout}`; - return { - ...acc, - [outpoint]: 1, - }; - }, {}) +export const selectBlacklistedOutpointMap = createSelector( + selectBlackListedOutpoints, + outpoints => + outpoints + ? outpoints.reduce((acc, val) => { + const outpoint = `${val.txid}:${val.nout}`; + return { + ...acc, + [outpoint]: 1, + }; + }, {}) + : {} ); diff --git a/src/redux/selectors/filtered.js b/src/redux/selectors/filtered.js index 7261f80..b1b8bfc 100644 --- a/src/redux/selectors/filtered.js +++ b/src/redux/selectors/filtered.js @@ -7,12 +7,16 @@ export const selectFilteredOutpoints = createSelector( state => state.filteredOutpoints ); -export const selectFilteredOutpointMap = createSelector(selectFilteredOutpoints, outpoints => - outpoints.reduce((acc, val) => { - const outpoint = `${val.txid}:${val.nout}`; - return { - ...acc, - [outpoint]: 1, - }; - }, {}) +export const selectFilteredOutpointMap = createSelector( + selectFilteredOutpoints, + outpoints => + outpoints + ? outpoints.reduce((acc, val) => { + const outpoint = `${val.txid}:${val.nout}`; + return { + ...acc, + [outpoint]: 1, + }; + }, {}) + : {} );