Merge pull request #84 from jessopb/listPersist

List persist
This commit is contained in:
Sean Yesmunt 2018-10-18 00:53:54 -04:00 committed by GitHub
commit 137a99ad1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 210 additions and 34 deletions

174
dist/bundle.js vendored
View file

@ -46,19 +46,34 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on 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 });
/******/ };
/******/
/******/ // 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
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
@ -89,8 +104,8 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.selectWalletUnlockResult = exports.selectWalletUnlockSucceeded = exports.selectWalletUnlockPending = exports.selectWalletDecryptResult = exports.selectWalletDecryptSucceeded = exports.selectWalletDecryptPending = exports.selectWalletEncryptResult = exports.selectWalletEncryptSucceeded = exports.selectWalletEncryptPending = exports.selectWalletState = exports.selectWalletIsEncrypted = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.makeSelectBlockDate = exports.selectSearchSuggestions = exports.selectSearchBarFocused = exports.selectWunderBarAddress = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchValue = exports.selectSearchQuery = exports.makeSelectSearchUris = exports.selectSearchState = exports.selectActiveHistoryEntry = exports.selectHistoryStack = exports.selectHistoryIndex = exports.selectIsForwardDisabled = exports.selectIsBackDisabled = exports.selectPathAfterAuth = exports.selectPageTitle = exports.selectHeaderLinks = exports.selectCurrentParams = exports.selectCurrentPage = exports.selectCurrentPath = exports.makeSelectCurrentParam = exports.computePageFromPath = exports.selectSearchDownloadUris = exports.selectTotalDownloadProgress = exports.selectDownloadingFileInfos = exports.selectFileInfosDownloaded = exports.selectUrisLoading = exports.selectDownloadingByOutpoint = exports.selectIsFetchingFileListDownloadedOrPublished = exports.selectIsFetchingFileList = exports.selectFileInfosByOutpoint = exports.makeSelectLoadingForUri = exports.makeSelectDownloadingForUri = exports.makeSelectFileInfoForUri = exports.selectFetchingCostInfo = exports.selectCostForCurrentPageUri = exports.selectAllCostInfoByUri = exports.makeSelectCostInfoForUri = exports.makeSelectFetchingCostInfoForUri = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = undefined;
exports.selectTrendingUris = exports.selectFetchingFeaturedUris = exports.selectFeaturedUris = exports.selectResolvingUris = exports.selectMyChannelClaims = exports.selectFetchingMyChannels = exports.selectMyClaimsOutpoints = exports.selectAllMyClaimsByOutpoint = exports.selectMyClaimsWithoutChannels = exports.selectMyClaims = exports.selectPendingClaims = exports.selectIsFetchingClaimListMine = exports.selectAllFetchingChannelClaims = exports.selectMyActiveClaims = exports.selectAbandoningIds = exports.selectMyClaimsRaw = exports.selectAllClaimsByChannel = exports.selectClaimsByUri = exports.selectClaimsById = exports.makeSelectRecommendedContentForUri = exports.makeSelectNsfwCountForChannel = exports.makeSelectNsfwCountFromUris = exports.makeSelectTotalPagesForChannel = exports.makeSelectTotalItemsForChannel = exports.makeSelectIsUriResolving = exports.makeSelectContentTypeForUri = exports.makeSelectTitleForUri = exports.makeSelectMetadataForUri = exports.makeSelectClaimsInChannelForPage = exports.makeSelectClaimsInChannelForCurrentPage = exports.makeSelectFetchingChannelClaims = exports.makeSelectClaimIsMine = exports.makeSelectClaimForUri = exports.selectSnack = exports.selectNotificationProps = exports.selectNotification = exports.selectBlackListedOutpoints = exports.blacklistReducer = exports.walletReducer = exports.searchReducer = exports.notificationsReducer = exports.fileInfoReducer = exports.costInfoReducer = exports.claimsReducer = exports.formatFullPrice = exports.formatCredits = exports.toQueryString = exports.parseQueryParams = exports.batchActions = exports.doWalletStatus = exports.doWalletUnlock = exports.doWalletDecrypt = exports.doWalletEncrypt = exports.doSendSupport = exports.doSetDraftTransactionAddress = exports.doSetDraftTransactionAmount = exports.doSendDraftTransaction = exports.doCheckAddressIsMine = exports.doGetNewAddress = exports.doFetchBlock = exports.doFetchTransactions = exports.doBalanceSubscribe = exports.doUpdateBalance = exports.doBlackListedOutpointsSubscribe = exports.doBlurSearchInput = exports.doFocusSearchInput = exports.doUpdateSearchQuery = exports.doSearch = exports.doFetchFileInfosAndPublishedClaims = exports.doFileList = exports.doFetchFileInfo = exports.doFetchCostInfoForUri = exports.doFetchTrendingUris = exports.doFetchFeaturedUris = exports.doResolveUri = exports.doResolveUris = exports.doAbandonClaim = exports.doFetchClaimListMine = exports.doFetchClaimCountByChannel = exports.doFetchClaimsByChannel = exports.doHideNotification = exports.doNotify = exports.convertToShareLink = exports.isNameValid = exports.isURIClaimable = exports.isURIValid = exports.normalizeURI = exports.buildURI = exports.parseURI = exports.regexAddress = exports.regexInvalidURI = exports.Lbryapi = exports.Lbry = exports.TRANSACTIONS = exports.SETTINGS = exports.SEARCH_TYPES = exports.THUMBNAIL_STATUSES = exports.MODALS = exports.ACTIONS = exports.Notification = undefined;
exports.selectTransactionListFilter = exports.selectWalletUnlockResult = exports.selectWalletUnlockSucceeded = exports.selectWalletUnlockPending = exports.selectWalletDecryptResult = exports.selectWalletDecryptSucceeded = exports.selectWalletDecryptPending = exports.selectWalletEncryptResult = exports.selectWalletEncryptSucceeded = exports.selectWalletEncryptPending = exports.selectWalletState = exports.selectWalletIsEncrypted = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.makeSelectBlockDate = exports.selectSearchSuggestions = exports.selectSearchBarFocused = exports.selectWunderBarAddress = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchValue = exports.selectSearchQuery = exports.makeSelectSearchUris = exports.selectSearchState = exports.selectActiveHistoryEntry = exports.selectHistoryStack = exports.selectHistoryIndex = exports.selectIsForwardDisabled = exports.selectIsBackDisabled = exports.selectPathAfterAuth = exports.selectPageTitle = exports.selectHeaderLinks = exports.selectCurrentParams = exports.selectCurrentPage = exports.selectCurrentPath = exports.makeSelectCurrentParam = exports.computePageFromPath = exports.selectDownloadListSort = exports.selectPublishListSort = exports.selectSearchDownloadUris = exports.selectTotalDownloadProgress = exports.selectDownloadingFileInfos = exports.selectFileInfosDownloaded = exports.selectUrisLoading = exports.selectDownloadingByOutpoint = exports.selectIsFetchingFileListDownloadedOrPublished = exports.selectIsFetchingFileList = exports.selectFileInfosByOutpoint = exports.makeSelectLoadingForUri = exports.makeSelectDownloadingForUri = exports.makeSelectFileInfoForUri = exports.selectFetchingCostInfo = exports.selectCostForCurrentPageUri = exports.selectAllCostInfoByUri = exports.makeSelectCostInfoForUri = exports.makeSelectFetchingCostInfoForUri = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = exports.selectTrendingUris = exports.selectFetchingFeaturedUris = exports.selectFeaturedUris = undefined;
exports.selectResolvingUris = exports.selectMyChannelClaims = exports.selectFetchingMyChannels = exports.selectMyClaimsOutpoints = exports.selectAllMyClaimsByOutpoint = exports.selectMyClaimsWithoutChannels = exports.selectMyClaims = exports.selectPendingClaims = exports.selectIsFetchingClaimListMine = exports.selectAllFetchingChannelClaims = exports.selectMyActiveClaims = exports.selectAbandoningIds = exports.selectMyClaimsRaw = exports.selectAllClaimsByChannel = exports.selectClaimsByUri = exports.selectClaimsById = exports.makeSelectRecommendedContentForUri = exports.makeSelectNsfwCountForChannel = exports.makeSelectNsfwCountFromUris = exports.makeSelectTotalPagesForChannel = exports.makeSelectTotalItemsForChannel = exports.makeSelectIsUriResolving = exports.makeSelectContentTypeForUri = exports.makeSelectTitleForUri = exports.makeSelectMetadataForUri = exports.makeSelectClaimsInChannelForPage = exports.makeSelectClaimsInChannelForCurrentPage = exports.makeSelectFetchingChannelClaims = exports.makeSelectClaimIsMine = exports.makeSelectClaimForUri = exports.selectSnack = exports.selectNotificationProps = exports.selectNotification = exports.selectBlackListedOutpoints = exports.blacklistReducer = exports.walletReducer = exports.searchReducer = exports.notificationsReducer = exports.fileInfoReducer = exports.costInfoReducer = exports.claimsReducer = exports.formatFullPrice = exports.formatCredits = exports.toQueryString = exports.parseQueryParams = exports.batchActions = exports.doSetTransactionListFilter = exports.doWalletStatus = exports.doWalletUnlock = exports.doWalletDecrypt = exports.doWalletEncrypt = exports.doSendSupport = exports.doSetDraftTransactionAddress = exports.doSetDraftTransactionAmount = exports.doSendDraftTransaction = exports.doCheckAddressIsMine = exports.doGetNewAddress = exports.doFetchBlock = exports.doFetchTransactions = exports.doBalanceSubscribe = exports.doUpdateBalance = exports.doBlackListedOutpointsSubscribe = exports.doBlurSearchInput = exports.doFocusSearchInput = exports.doUpdateSearchQuery = exports.doSearch = exports.doSetPublishListSort = exports.doSetDownloadListSort = exports.doFetchFileInfosAndPublishedClaims = exports.doFileList = exports.doFetchFileInfo = exports.doFetchCostInfoForUri = exports.doFetchTrendingUris = exports.doFetchFeaturedUris = exports.doResolveUri = exports.doResolveUris = exports.doAbandonClaim = exports.doFetchClaimListMine = exports.doFetchClaimCountByChannel = exports.doFetchClaimsByChannel = exports.doHideNotification = exports.doNotify = exports.convertToShareLink = exports.isNameValid = exports.isURIClaimable = exports.isURIValid = exports.normalizeURI = exports.buildURI = exports.parseURI = exports.regexAddress = exports.regexInvalidURI = exports.Lbryapi = exports.Lbry = exports.TRANSACTIONS = exports.SETTINGS = exports.SEARCH_TYPES = exports.THUMBNAIL_STATUSES = exports.MODALS = exports.ACTIONS = exports.Notification = undefined;
var _Notification = __webpack_require__(1);
@ -253,6 +268,18 @@ Object.defineProperty(exports, 'doFetchFileInfosAndPublishedClaims', {
return _file_info.doFetchFileInfosAndPublishedClaims;
}
});
Object.defineProperty(exports, 'doSetDownloadListSort', {
enumerable: true,
get: function get() {
return _file_info.doSetDownloadListSort;
}
});
Object.defineProperty(exports, 'doSetPublishListSort', {
enumerable: true,
get: function get() {
return _file_info.doSetPublishListSort;
}
});
var _search = __webpack_require__(25);
@ -376,6 +403,12 @@ Object.defineProperty(exports, 'doWalletStatus', {
return _wallet.doWalletStatus;
}
});
Object.defineProperty(exports, 'doSetTransactionListFilter', {
enumerable: true,
get: function get() {
return _wallet.doSetTransactionListFilter;
}
});
var _batchActions = __webpack_require__(21);
@ -835,6 +868,18 @@ Object.defineProperty(exports, 'selectSearchDownloadUris', {
return _file_info3.selectSearchDownloadUris;
}
});
Object.defineProperty(exports, 'selectPublishListSort', {
enumerable: true,
get: function get() {
return _file_info3.selectPublishListSort;
}
});
Object.defineProperty(exports, 'selectDownloadListSort', {
enumerable: true,
get: function get() {
return _file_info3.selectDownloadListSort;
}
});
var _navigation = __webpack_require__(15);
@ -1126,6 +1171,12 @@ Object.defineProperty(exports, 'selectWalletUnlockResult', {
return _wallet3.selectWalletUnlockResult;
}
});
Object.defineProperty(exports, 'selectTransactionListFilter', {
enumerable: true,
get: function get() {
return _wallet3.selectTransactionListFilter;
}
});
var _action_types = __webpack_require__(4);
@ -1564,6 +1615,7 @@ var WALLET_LOCK_COMPLETED = exports.WALLET_LOCK_COMPLETED = 'WALLET_LOCK_COMPLET
var WALLET_LOCK_FAILED = exports.WALLET_LOCK_FAILED = 'WALLET_LOCK_FAILED';
var WALLET_STATUS_START = exports.WALLET_STATUS_START = 'WALLET_STATUS_START';
var WALLET_STATUS_COMPLETED = exports.WALLET_STATUS_COMPLETED = 'WALLET_STATUS_COMPLETED';
var SET_TRANSACTION_LIST_FILTER = exports.SET_TRANSACTION_LIST_FILTER = 'SET_TRANSACTION_LIST_FILTER';
// Claims
var FETCH_FEATURED_CONTENT_STARTED = exports.FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED';
@ -1615,6 +1667,8 @@ var PLAY_VIDEO_STARTED = exports.PLAY_VIDEO_STARTED = 'PLAY_VIDEO_STARTED';
var FETCH_AVAILABILITY_STARTED = exports.FETCH_AVAILABILITY_STARTED = 'FETCH_AVAILABILITY_STARTED';
var FETCH_AVAILABILITY_COMPLETED = exports.FETCH_AVAILABILITY_COMPLETED = 'FETCH_AVAILABILITY_COMPLETED';
var FILE_DELETE = exports.FILE_DELETE = 'FILE_DELETE';
var SET_PUBLISH_LIST_SORT = exports.SET_PUBLISH_LIST_SORT = 'SET_PUBLISH_LIST_SORT';
var SET_DOWNLOAD_LIST_SORT = exports.SET_DOWNLOAD_LIST_SORT = 'SET_DOWNLOAD_LIST_SORT';
// Search
var SEARCH_START = exports.SEARCH_START = 'SEARCH_START';
@ -2444,26 +2498,26 @@ exports.default = lbryProxy;
/* 8 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1, eval)("this");
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1, eval)("this");
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
@ -3789,6 +3843,8 @@ Object.defineProperty(exports, "__esModule", {
exports.doFetchFileInfo = doFetchFileInfo;
exports.doFileList = doFileList;
exports.doFetchFileInfosAndPublishedClaims = doFetchFileInfosAndPublishedClaims;
exports.doSetPublishListSort = doSetPublishListSort;
exports.doSetDownloadListSort = doSetDownloadListSort;
var _action_types = __webpack_require__(4);
@ -3869,6 +3925,20 @@ function doFetchFileInfosAndPublishedClaims() {
};
}
function doSetPublishListSort(sortOption) {
return {
type: ACTIONS.SET_PUBLISH_LIST_SORT,
data: sortOption
};
}
function doSetDownloadListSort(sortOption) {
return {
type: ACTIONS.SET_DOWNLOAD_LIST_SORT,
data: sortOption
};
}
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
@ -3879,7 +3949,7 @@ function doFetchFileInfosAndPublishedClaims() {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.selectSearchDownloadUris = exports.selectTotalDownloadProgress = exports.selectDownloadingFileInfos = exports.selectFileInfosDownloaded = exports.makeSelectLoadingForUri = exports.selectUrisLoading = exports.makeSelectDownloadingForUri = exports.selectDownloadingByOutpoint = exports.makeSelectFileInfoForUri = exports.selectIsFetchingFileListDownloadedOrPublished = exports.selectIsFetchingFileList = exports.selectFileInfosByOutpoint = exports.selectState = undefined;
exports.selectDownloadListSort = exports.selectPublishListSort = exports.selectSearchDownloadUris = exports.selectTotalDownloadProgress = exports.selectDownloadingFileInfos = exports.selectFileInfosDownloaded = exports.makeSelectLoadingForUri = exports.selectUrisLoading = exports.makeSelectDownloadingForUri = exports.selectDownloadingByOutpoint = exports.makeSelectFileInfoForUri = exports.selectIsFetchingFileListDownloadedOrPublished = exports.selectIsFetchingFileList = exports.selectFileInfosByOutpoint = exports.selectState = undefined;
var _claims = __webpack_require__(14);
@ -4076,6 +4146,14 @@ var selectSearchDownloadUris = exports.selectSearchDownloadUris = function selec
});
};
var selectPublishListSort = exports.selectPublishListSort = (0, _reselect.createSelector)(selectState, function (state) {
return state.publishListSort || '';
});
var selectDownloadListSort = exports.selectDownloadListSort = (0, _reselect.createSelector)(selectState, function (state) {
return state.downloadListSort || '';
});
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
@ -4364,6 +4442,7 @@ exports.doWalletUnlock = doWalletUnlock;
exports.doWalletLock = doWalletLock;
exports.doWalletDecrypt = doWalletDecrypt;
exports.doWalletStatus = doWalletStatus;
exports.doSetTransactionListFilter = doSetTransactionListFilter;
var _action_types = __webpack_require__(4);
@ -4714,6 +4793,13 @@ function doWalletStatus() {
};
}
function doSetTransactionListFilter(filterOption) {
return {
type: ACTIONS.SET_TRANSACTION_LIST_FILTER,
data: filterOption
};
}
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
@ -4724,7 +4810,7 @@ function doWalletStatus() {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.makeSelectBlockDate = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.selectWalletLockResult = exports.selectWalletLockSucceeded = exports.selectWalletLockPending = exports.selectWalletUnlockResult = exports.selectWalletUnlockSucceeded = exports.selectWalletUnlockPending = exports.selectWalletDecryptResult = exports.selectWalletDecryptSucceeded = exports.selectWalletDecryptPending = exports.selectWalletEncryptResult = exports.selectWalletEncryptSucceeded = exports.selectWalletEncryptPending = exports.selectWalletIsEncrypted = exports.selectWalletState = exports.selectState = undefined;
exports.selectTransactionListFilter = exports.makeSelectBlockDate = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.selectWalletLockResult = exports.selectWalletLockSucceeded = exports.selectWalletLockPending = exports.selectWalletUnlockResult = exports.selectWalletUnlockSucceeded = exports.selectWalletUnlockPending = exports.selectWalletDecryptResult = exports.selectWalletDecryptSucceeded = exports.selectWalletDecryptPending = exports.selectWalletEncryptResult = exports.selectWalletEncryptSucceeded = exports.selectWalletEncryptPending = exports.selectWalletIsEncrypted = exports.selectWalletState = exports.selectState = undefined;
var _reselect = __webpack_require__(16);
@ -4913,6 +4999,10 @@ var makeSelectBlockDate = exports.makeSelectBlockDate = function makeSelectBlock
});
};
var selectTransactionListFilter = exports.selectTransactionListFilter = (0, _reselect.createSelector)(selectState, function (state) {
return state.transactionListFilter || '';
});
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
@ -5371,7 +5461,10 @@ var ACTIONS = _interopRequireWildcard(_action_types);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var reducers = {};
var defaultState = {};
var defaultState = {
downloadListSort: '',
publishListSort: ''
};
reducers[ACTIONS.FILE_LIST_STARTED] = function (state) {
return Object.assign({}, state, {
@ -5546,6 +5639,18 @@ reducers[ACTIONS.FETCH_DATE] = function (state, action) {
return null;
};
reducers[ACTIONS.SET_PUBLISH_LIST_SORT] = function (state, action) {
return Object.assign({}, state, {
publishListSort: action.data
});
};
reducers[ACTIONS.SET_DOWNLOAD_LIST_SORT] = function (state, action) {
return Object.assign({}, state, {
downloadListSort: action.data
});
};
function fileInfoReducer() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action = arguments[1];
@ -5917,7 +6022,8 @@ var defaultState = {
walletUnlockResult: null,
walletLockPending: false,
walletLockSucceded: null,
walletLockResult: null
walletLockResult: null,
transactionListFilter: 'all'
};
reducers[ACTIONS.FETCH_TRANSACTIONS_STARTED] = function (state /*: WalletState*/) {
@ -6159,6 +6265,12 @@ reducers[ACTIONS.WALLET_LOCK_FAILED] = function (state /*: WalletState*/, action
});
};
reducers[ACTIONS.SET_TRANSACTION_LIST_FILTER] = function (state /*: WalletState*/, action /*: {}*/) {
return Object.assign({}, state, {
transactionListFilter: action.data
});
};
function walletReducer() {
var state /*: WalletState*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action /*: ActionResult*/ = arguments[1];

View file

@ -57,6 +57,7 @@ export const WALLET_LOCK_COMPLETED = 'WALLET_LOCK_COMPLETED';
export const WALLET_LOCK_FAILED = 'WALLET_LOCK_FAILED';
export const WALLET_STATUS_START = 'WALLET_STATUS_START';
export const WALLET_STATUS_COMPLETED = 'WALLET_STATUS_COMPLETED';
export const SET_TRANSACTION_LIST_FILTER = 'SET_TRANSACTION_LIST_FILTER';
// Claims
export const FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED';
@ -108,6 +109,8 @@ export const PLAY_VIDEO_STARTED = 'PLAY_VIDEO_STARTED';
export const FETCH_AVAILABILITY_STARTED = 'FETCH_AVAILABILITY_STARTED';
export const FETCH_AVAILABILITY_COMPLETED = 'FETCH_AVAILABILITY_COMPLETED';
export const FILE_DELETE = 'FILE_DELETE';
export const SET_PUBLISH_LIST_SORT = 'SET_PUBLISH_LIST_SORT';
export const SET_DOWNLOAD_LIST_SORT = 'SET_DOWNLOAD_LIST_SORT';
// Search
export const SEARCH_START = 'SEARCH_START';

View file

@ -48,6 +48,8 @@ export {
doFetchFileInfo,
doFileList,
doFetchFileInfosAndPublishedClaims,
doSetDownloadListSort,
doSetPublishListSort,
} from 'redux/actions/file_info';
export {
@ -74,6 +76,7 @@ export {
doWalletDecrypt,
doWalletUnlock,
doWalletStatus,
doSetTransactionListFilter,
} from 'redux/actions/wallet';
// utils
@ -159,6 +162,8 @@ export {
selectDownloadingFileInfos,
selectTotalDownloadProgress,
selectSearchDownloadUris,
selectPublishListSort,
selectDownloadListSort,
} from 'redux/selectors/file_info';
export {
@ -216,4 +221,5 @@ export {
selectWalletUnlockPending,
selectWalletUnlockSucceeded,
selectWalletUnlockResult,
selectTransactionListFilter,
} from 'redux/selectors/wallet';

View file

@ -64,3 +64,17 @@ export function doFetchFileInfosAndPublishedClaims() {
if (!isFetchingFileInfo) dispatch(doFileList());
};
}
export function doSetPublishListSort(sortOption) {
return {
type: ACTIONS.SET_PUBLISH_LIST_SORT,
data: sortOption,
};
}
export function doSetDownloadListSort(sortOption) {
return {
type: ACTIONS.SET_DOWNLOAD_LIST_SORT,
data: sortOption,
};
}

View file

@ -347,3 +347,10 @@ export function doWalletStatus() {
});
};
}
export function doSetTransactionListFilter(filterOption) {
return {
type: ACTIONS.SET_TRANSACTION_LIST_FILTER,
data: filterOption,
};
}

View file

@ -1,7 +1,10 @@
import * as ACTIONS from 'constants/action_types';
const reducers = {};
const defaultState = {};
const defaultState = {
downloadListSort: '',
publishListSort: '',
};
reducers[ACTIONS.FILE_LIST_STARTED] = state =>
Object.assign({}, state, {
@ -155,6 +158,16 @@ reducers[ACTIONS.FETCH_DATE] = (state, action) => {
return null;
};
reducers[ACTIONS.SET_PUBLISH_LIST_SORT] = (state, action) =>
Object.assign({}, state, {
publishListSort: action.data,
});
reducers[ACTIONS.SET_DOWNLOAD_LIST_SORT] = (state, action) =>
Object.assign({}, state, {
downloadListSort: action.data,
});
export function fileInfoReducer(state = defaultState, action) {
const handler = reducers[action.type];
if (handler) return handler(state, action);

View file

@ -58,6 +58,7 @@ const defaultState = {
walletLockPending: false,
walletLockSucceded: null,
walletLockResult: null,
transactionListFilter: 'all',
};
reducers[ACTIONS.FETCH_TRANSACTIONS_STARTED] = (state: WalletState) =>
@ -275,6 +276,11 @@ reducers[ACTIONS.WALLET_LOCK_FAILED] = (state: WalletState, action: ActionResult
walletLockResult: action.result,
});
reducers[ACTIONS.SET_TRANSACTION_LIST_FILTER] = (state: WalletState, action: {}) =>
Object.assign({}, state, {
transactionListFilter: action.data,
});
export function walletReducer(state: WalletState = defaultState, action: ActionResult) {
const handler = reducers[action.type];
if (handler) return handler(state, action);

View file

@ -97,7 +97,7 @@ export const selectTotalDownloadProgress = createSelector(selectDownloadingFileI
const progress = [];
fileInfos.forEach(fileInfo => {
progress.push(fileInfo.written_bytes / fileInfo.total_bytes * 100);
progress.push((fileInfo.written_bytes / fileInfo.total_bytes) * 100);
});
const totalProgress = progress.reduce((a, b) => a + b, 0);
@ -195,3 +195,13 @@ export const selectSearchDownloadUris = query =>
})
: null;
});
export const selectPublishListSort = createSelector(
selectState,
state => state.publishListSort || ''
);
export const selectDownloadListSort = createSelector(
selectState,
state => state.downloadListSort || ''
);

View file

@ -130,7 +130,7 @@ export const selectTransactionItems = createSelector(selectTransactionsById, byI
txid,
date: tx.timestamp ? new Date(Number(tx.timestamp) * 1000) : null,
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_name: item.claim_name,
type: item.type || TRANSACTIONS.SPEND,
@ -194,3 +194,8 @@ export const makeSelectBlockDate = block =>
selectBlocks,
blocks => (blocks && blocks[block] ? new Date(blocks[block].time * 1000) : undefined)
);
export const selectTransactionListFilter = createSelector(
selectState,
state => state.transactionListFilter || ''
);