Merge pull request #52 from lbryio/abandon-filter

label abandon(ed) claims
This commit is contained in:
Sean Yesmunt 2018-07-11 22:50:42 -04:00 committed by GitHub
commit 818af46ab0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 28 deletions

30
dist/bundle.js vendored
View file

@ -46,19 +46,34 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // define getter function for harmony exports /******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) { /******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) { /******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ } /******/ }
/******/ }; /******/ };
/******/ /******/
/******/ // define __esModule on exports /******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) { /******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ }; /******/ };
/******/ /******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules /******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) { /******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ? /******/ var getter = module && module.__esModule ?
@ -4643,7 +4658,7 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea
// ignore dust/fees // ignore dust/fees
// it is fee only txn if all infos are also empty // it is fee only txn if all infos are also empty
if (Math.abs(tx.value) === Math.abs(tx.fee) && tx.claim_info.length === 0 && tx.support_info.length === 0 && tx.update_info.length === 0) { if (Math.abs(tx.value) === Math.abs(tx.fee) && tx.claim_info.length === 0 && tx.support_info.length === 0 && tx.update_info.length === 0 && tx.abandon_info.length === 0) {
return; return;
} }
@ -4662,6 +4677,9 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea
append.push.apply(append, _toConsumableArray(tx.update_info.map(function (item) { append.push.apply(append, _toConsumableArray(tx.update_info.map(function (item) {
return Object.assign({}, tx, item, { type: 'update' }); return Object.assign({}, tx, item, { type: 'update' });
}))); })));
append.push.apply(append, _toConsumableArray(tx.abandon_info.map(function (item) {
return Object.assign({}, tx, item, { type: 'abandon' });
})));
if (!append.length) { if (!append.length) {
append.push(Object.assign({}, tx, { append.push(Object.assign({}, tx, {

View file

@ -18,7 +18,8 @@ export const selectTransactionItems = createSelector(selectTransactionsById, byI
Math.abs(tx.value) === Math.abs(tx.fee) && Math.abs(tx.value) === Math.abs(tx.fee) &&
tx.claim_info.length === 0 && tx.claim_info.length === 0 &&
tx.support_info.length === 0 && tx.support_info.length === 0 &&
tx.update_info.length === 0 tx.update_info.length === 0 &&
tx.abandon_info.length === 0
) { ) {
return; return;
} }
@ -40,6 +41,7 @@ export const selectTransactionItems = createSelector(selectTransactionsById, byI
) )
); );
append.push(...tx.update_info.map(item => Object.assign({}, tx, item, { type: 'update' }))); append.push(...tx.update_info.map(item => Object.assign({}, tx, item, { type: 'update' })));
append.push(...tx.abandon_info.map(item => Object.assign({}, tx, item, { type: 'abandon' })));
if (!append.length) { if (!append.length) {
append.push( append.push(
@ -59,7 +61,7 @@ export const selectTransactionItems = createSelector(selectTransactionsById, byI
txid, txid,
date: tx.timestamp ? new Date(Number(tx.timestamp) * 1000) : null, date: tx.timestamp ? new Date(Number(tx.timestamp) * 1000) : null,
amount, amount,
fee: amount < 0 ? -1 * tx.fee / append.length : 0, fee: amount < 0 ? (-1 * tx.fee) / append.length : 0,
claim_id: item.claim_id, claim_id: item.claim_id,
claim_name: item.claim_name, claim_name: item.claim_name,
type: item.type || 'send', type: item.type || 'send',