diff --git a/dist/bundle.js b/dist/bundle.js index e22de0f..e27a65c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1076,34 +1076,19 @@ 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, { enumerable: true, get: getter }); +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ 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 ? @@ -1134,8 +1119,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.selectNavLinks = 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.selectRewardContentClaimIds = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = exports.selectTrendingUris = undefined; -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.doFetchRewardedContent = 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.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.selectSearchBarFocused = exports.selectWunderBarAddress = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchValue = exports.selectSearchQuery = exports.makeSelectSearchUris = exports.selectSearchState = exports.selectNavLinks = 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 = undefined; +exports.selectAllCostInfoByUri = exports.makeSelectCostInfoForUri = exports.makeSelectFetchingCostInfoForUri = exports.selectRewardContentClaimIds = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = 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.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.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.doFetchRewardedContent = 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.SETTINGS = exports.SEARCH_TYPES = exports.THUMBNAIL_STATUSES = exports.MODALS = exports.ACTIONS = exports.Notification = undefined; var _Notification = __webpack_require__(1); @@ -1275,7 +1260,7 @@ Object.defineProperty(exports, 'doFetchRewardedContent', { } }); -var _cost_info = __webpack_require__(22); +var _cost_info = __webpack_require__(19); Object.defineProperty(exports, 'doFetchCostInfoForUri', { enumerable: true, @@ -1284,7 +1269,7 @@ Object.defineProperty(exports, 'doFetchCostInfoForUri', { } }); -var _file_info = __webpack_require__(23); +var _file_info = __webpack_require__(20); Object.defineProperty(exports, 'doFetchFileInfo', { enumerable: true, @@ -1305,7 +1290,7 @@ Object.defineProperty(exports, 'doFetchFileInfosAndPublishedClaims', { } }); -var _search = __webpack_require__(25); +var _search = __webpack_require__(22); Object.defineProperty(exports, 'doSearch', { enumerable: true, @@ -1332,7 +1317,7 @@ Object.defineProperty(exports, 'doBlurSearchInput', { } }); -var _blacklist = __webpack_require__(27); +var _blacklist = __webpack_require__(26); Object.defineProperty(exports, 'doBlackListedOutpointsSubscribe', { enumerable: true, @@ -1341,7 +1326,7 @@ Object.defineProperty(exports, 'doBlackListedOutpointsSubscribe', { } }); -var _wallet = __webpack_require__(28); +var _wallet = __webpack_require__(27); Object.defineProperty(exports, 'doUpdateBalance', { enumerable: true, @@ -1403,32 +1388,8 @@ Object.defineProperty(exports, 'doSendSupport', { return _wallet.doSendSupport; } }); -Object.defineProperty(exports, 'doWalletEncrypt', { - enumerable: true, - get: function get() { - return _wallet.doWalletEncrypt; - } -}); -Object.defineProperty(exports, 'doWalletDecrypt', { - enumerable: true, - get: function get() { - return _wallet.doWalletDecrypt; - } -}); -Object.defineProperty(exports, 'doWalletUnlock', { - enumerable: true, - get: function get() { - return _wallet.doWalletUnlock; - } -}); -Object.defineProperty(exports, 'doWalletStatus', { - enumerable: true, - get: function get() { - return _wallet.doWalletStatus; - } -}); -var _batchActions = __webpack_require__(21); +var _batchActions = __webpack_require__(18); Object.defineProperty(exports, 'batchActions', { enumerable: true, @@ -1452,7 +1413,7 @@ Object.defineProperty(exports, 'toQueryString', { } }); -var _formatCredits = __webpack_require__(31); +var _formatCredits = __webpack_require__(29); Object.defineProperty(exports, 'formatCredits', { enumerable: true, @@ -1467,7 +1428,7 @@ Object.defineProperty(exports, 'formatFullPrice', { } }); -var _claims2 = __webpack_require__(32); +var _claims2 = __webpack_require__(30); Object.defineProperty(exports, 'claimsReducer', { enumerable: true, @@ -1476,7 +1437,7 @@ Object.defineProperty(exports, 'claimsReducer', { } }); -var _cost_info2 = __webpack_require__(33); +var _cost_info2 = __webpack_require__(31); Object.defineProperty(exports, 'costInfoReducer', { enumerable: true, @@ -1485,7 +1446,7 @@ Object.defineProperty(exports, 'costInfoReducer', { } }); -var _file_info2 = __webpack_require__(34); +var _file_info2 = __webpack_require__(32); Object.defineProperty(exports, 'fileInfoReducer', { enumerable: true, @@ -1494,7 +1455,7 @@ Object.defineProperty(exports, 'fileInfoReducer', { } }); -var _notifications2 = __webpack_require__(35); +var _notifications2 = __webpack_require__(33); Object.defineProperty(exports, 'notificationsReducer', { enumerable: true, @@ -1503,7 +1464,7 @@ Object.defineProperty(exports, 'notificationsReducer', { } }); -var _search2 = __webpack_require__(37); +var _search2 = __webpack_require__(35); Object.defineProperty(exports, 'searchReducer', { enumerable: true, @@ -1512,7 +1473,7 @@ Object.defineProperty(exports, 'searchReducer', { } }); -var _wallet2 = __webpack_require__(39); +var _wallet2 = __webpack_require__(37); Object.defineProperty(exports, 'walletReducer', { enumerable: true, @@ -1521,7 +1482,7 @@ Object.defineProperty(exports, 'walletReducer', { } }); -var _blacklist2 = __webpack_require__(40); +var _blacklist2 = __webpack_require__(38); Object.defineProperty(exports, 'blacklistReducer', { enumerable: true, @@ -1530,7 +1491,7 @@ Object.defineProperty(exports, 'blacklistReducer', { } }); -var _blacklist3 = __webpack_require__(41); +var _blacklist3 = __webpack_require__(39); Object.defineProperty(exports, 'selectBlackListedOutpoints', { enumerable: true, @@ -1539,7 +1500,7 @@ Object.defineProperty(exports, 'selectBlackListedOutpoints', { } }); -var _notifications3 = __webpack_require__(42); +var _notifications3 = __webpack_require__(40); Object.defineProperty(exports, 'selectNotification', { enumerable: true, @@ -1628,24 +1589,6 @@ Object.defineProperty(exports, 'makeSelectTotalPagesForChannel', { return _claims3.makeSelectTotalPagesForChannel; } }); -Object.defineProperty(exports, 'makeSelectNsfwCountFromUris', { - enumerable: true, - get: function get() { - return _claims3.makeSelectNsfwCountFromUris; - } -}); -Object.defineProperty(exports, 'makeSelectNsfwCountForChannel', { - enumerable: true, - get: function get() { - return _claims3.makeSelectNsfwCountForChannel; - } -}); -Object.defineProperty(exports, 'makeSelectRecommendedContentForUri', { - enumerable: true, - get: function get() { - return _claims3.makeSelectRecommendedContentForUri; - } -}); Object.defineProperty(exports, 'selectClaimsById', { enumerable: true, get: function get() { @@ -1785,7 +1728,7 @@ Object.defineProperty(exports, 'selectRewardContentClaimIds', { } }); -var _cost_info3 = __webpack_require__(43); +var _cost_info3 = __webpack_require__(41); Object.defineProperty(exports, 'makeSelectFetchingCostInfoForUri', { enumerable: true, @@ -1818,7 +1761,7 @@ Object.defineProperty(exports, 'selectFetchingCostInfo', { } }); -var _file_info3 = __webpack_require__(24); +var _file_info3 = __webpack_require__(21); Object.defineProperty(exports, 'makeSelectFileInfoForUri', { enumerable: true, @@ -1980,7 +1923,7 @@ Object.defineProperty(exports, 'selectNavLinks', { } }); -var _search3 = __webpack_require__(18); +var _search3 = __webpack_require__(24); Object.defineProperty(exports, 'makeSelectSearchUris', { enumerable: true, @@ -2024,14 +1967,8 @@ Object.defineProperty(exports, 'selectSearchBarFocused', { return _search3.selectSearchBarFocused; } }); -Object.defineProperty(exports, 'selectSearchSuggestions', { - enumerable: true, - get: function get() { - return _search3.selectSearchSuggestions; - } -}); -var _wallet3 = __webpack_require__(29); +var _wallet3 = __webpack_require__(28); Object.defineProperty(exports, 'makeSelectBlockDate', { enumerable: true, @@ -2123,97 +2060,27 @@ Object.defineProperty(exports, 'selectBlocks', { return _wallet3.selectBlocks; } }); -Object.defineProperty(exports, 'selectWalletIsEncrypted', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletIsEncrypted; - } -}); -Object.defineProperty(exports, 'selectWalletState', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletState; - } -}); -Object.defineProperty(exports, 'selectWalletEncryptPending', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletEncryptPending; - } -}); -Object.defineProperty(exports, 'selectWalletEncryptSucceeded', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletEncryptSucceeded; - } -}); -Object.defineProperty(exports, 'selectWalletEncryptResult', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletEncryptResult; - } -}); -Object.defineProperty(exports, 'selectWalletDecryptPending', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletDecryptPending; - } -}); -Object.defineProperty(exports, 'selectWalletDecryptSucceeded', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletDecryptSucceeded; - } -}); -Object.defineProperty(exports, 'selectWalletDecryptResult', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletDecryptResult; - } -}); -Object.defineProperty(exports, 'selectWalletUnlockPending', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletUnlockPending; - } -}); -Object.defineProperty(exports, 'selectWalletUnlockSucceeded', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletUnlockSucceeded; - } -}); -Object.defineProperty(exports, 'selectWalletUnlockResult', { - enumerable: true, - get: function get() { - return _wallet3.selectWalletUnlockResult; - } -}); var _action_types = __webpack_require__(4); var ACTIONS = _interopRequireWildcard(_action_types); -var _modal_types = __webpack_require__(36); +var _modal_types = __webpack_require__(34); var MODALS = _interopRequireWildcard(_modal_types); -var _thumbnail_upload_statuses = __webpack_require__(44); +var _thumbnail_upload_statuses = __webpack_require__(42); var THUMBNAIL_STATUSES = _interopRequireWildcard(_thumbnail_upload_statuses); -var _search4 = __webpack_require__(19); +var _search4 = __webpack_require__(23); var SEARCH_TYPES = _interopRequireWildcard(_search4); -var _settings = __webpack_require__(45); +var _settings = __webpack_require__(43); var SETTINGS = _interopRequireWildcard(_settings); -var _transaction_types = __webpack_require__(30); - -var TRANSACTIONS = _interopRequireWildcard(_transaction_types); - var _lbry = __webpack_require__(6); var _lbry2 = _interopRequireDefault(_lbry); @@ -2232,7 +2099,6 @@ exports.MODALS = MODALS; exports.THUMBNAIL_STATUSES = THUMBNAIL_STATUSES; exports.SEARCH_TYPES = SEARCH_TYPES; exports.SETTINGS = SETTINGS; -exports.TRANSACTIONS = TRANSACTIONS; // common @@ -2601,7 +2467,6 @@ var SKIP_UPGRADE = exports.SKIP_UPGRADE = 'SKIP_UPGRADE'; var START_UPGRADE = exports.START_UPGRADE = 'START_UPGRADE'; var AUTO_UPDATE_DECLINED = exports.AUTO_UPDATE_DECLINED = 'AUTO_UPDATE_DECLINED'; var AUTO_UPDATE_DOWNLOADED = exports.AUTO_UPDATE_DOWNLOADED = 'AUTO_UPDATE_DOWNLOADED'; -var CLEAR_UPGRADE_TIMER = exports.CLEAR_UPGRADE_TIMER = 'CLEAR_UPGRADE_TIMER'; // Wallet var GET_NEW_ADDRESS_STARTED = exports.GET_NEW_ADDRESS_STARTED = 'GET_NEW_ADDRESS_STARTED'; @@ -2618,20 +2483,6 @@ var FETCH_BLOCK_SUCCESS = exports.FETCH_BLOCK_SUCCESS = 'FETCH_BLOCK_SUCCESS'; var SUPPORT_TRANSACTION_STARTED = exports.SUPPORT_TRANSACTION_STARTED = 'SUPPORT_TRANSACTION_STARTED'; var SUPPORT_TRANSACTION_COMPLETED = exports.SUPPORT_TRANSACTION_COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED'; var SUPPORT_TRANSACTION_FAILED = exports.SUPPORT_TRANSACTION_FAILED = 'SUPPORT_TRANSACTION_FAILED'; -var WALLET_ENCRYPT_START = exports.WALLET_ENCRYPT_START = 'WALLET_ENCRYPT_START'; -var WALLET_ENCRYPT_COMPLETED = exports.WALLET_ENCRYPT_COMPLETED = 'WALLET_ENCRYPT_COMPLETED'; -var WALLET_ENCRYPT_FAILED = exports.WALLET_ENCRYPT_FAILED = 'WALLET_ENCRYPT_FAILED'; -var WALLET_UNLOCK_START = exports.WALLET_UNLOCK_START = 'WALLET_UNLOCK_START'; -var WALLET_UNLOCK_COMPLETED = exports.WALLET_UNLOCK_COMPLETED = 'WALLET_UNLOCK_COMPLETED'; -var WALLET_UNLOCK_FAILED = exports.WALLET_UNLOCK_FAILED = 'WALLET_UNLOCK_FAILED'; -var WALLET_DECRYPT_START = exports.WALLET_DECRYPT_START = 'WALLET_DECRYPT_START'; -var WALLET_DECRYPT_COMPLETED = exports.WALLET_DECRYPT_COMPLETED = 'WALLET_DECRYPT_COMPLETED'; -var WALLET_DECRYPT_FAILED = exports.WALLET_DECRYPT_FAILED = 'WALLET_DECRYPT_FAILED'; -var WALLET_LOCK_START = exports.WALLET_LOCK_START = 'WALLET_LOCK_START'; -var WALLET_LOCK_COMPLETED = exports.WALLET_LOCK_COMPLETED = 'WALLET_LOCK_COMPLETED'; -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'; // Claims var FETCH_FEATURED_CONTENT_STARTED = exports.FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED'; @@ -2703,7 +2554,6 @@ var USER_EMAIL_NEW_STARTED = exports.USER_EMAIL_NEW_STARTED = 'USER_EMAIL_NEW_ST var USER_EMAIL_NEW_SUCCESS = exports.USER_EMAIL_NEW_SUCCESS = 'USER_EMAIL_NEW_SUCCESS'; var USER_EMAIL_NEW_EXISTS = exports.USER_EMAIL_NEW_EXISTS = 'USER_EMAIL_NEW_EXISTS'; var USER_EMAIL_NEW_FAILURE = exports.USER_EMAIL_NEW_FAILURE = 'USER_EMAIL_NEW_FAILURE'; -var USER_EMAIL_VERIFY_SET = exports.USER_EMAIL_VERIFY_SET = 'USER_EMAIL_VERIFY_SET'; var USER_EMAIL_VERIFY_STARTED = exports.USER_EMAIL_VERIFY_STARTED = 'USER_EMAIL_VERIFY_STARTED'; var USER_EMAIL_VERIFY_SUCCESS = exports.USER_EMAIL_VERIFY_SUCCESS = 'USER_EMAIL_VERIFY_SUCCESS'; var USER_EMAIL_VERIFY_FAILURE = exports.USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE'; @@ -2830,7 +2680,7 @@ var _notifications = __webpack_require__(3); var _claims = __webpack_require__(14); -var _batchActions = __webpack_require__(21); +var _batchActions = __webpack_require__(18); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3173,16 +3023,6 @@ var daemonCallWithResult = function daemonCallWithResult(name) { }); }; -// blobs -Lbry.blob_delete = function () { - var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return daemonCallWithResult('blob_delete', params); -}; -Lbry.blob_list = function () { - var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return daemonCallWithResult('blob_list', params); -}; - // core Lbry.status = function () { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -3211,20 +3051,10 @@ Lbry.wallet_balance = function () { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return daemonCallWithResult('wallet_balance', params); }; -Lbry.wallet_decrypt = function () { - return daemonCallWithResult('wallet_decrypt', {}); -}; -Lbry.wallet_encrypt = function () { - var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return daemonCallWithResult('wallet_encrypt', params); -}; Lbry.wallet_is_address_mine = function () { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return daemonCallWithResult('wallet_is_address_mine', params); }; -Lbry.wallet_lock = function () { - return daemonCallWithResult('wallet_lock', {}); -}; Lbry.wallet_new_address = function () { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return daemonCallWithResult('wallet_new_address', params); @@ -3233,13 +3063,17 @@ Lbry.wallet_send = function () { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return daemonCallWithResult('wallet_send', params); }; +Lbry.wallet_encrypt = function () { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return daemonCallWithResult('wallet_encrypt', params); +}; +Lbry.wallet_decrypt = function () { + return daemonCallWithResult('wallet_decrypt', {}); +}; Lbry.wallet_unlock = function () { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return daemonCallWithResult('wallet_unlock', params); }; -Lbry.wallet_unused_address = function () { - return daemonCallWithResult('wallet_unused_address', {}); -}; // transactions Lbry.transaction_list = function () { @@ -3271,9 +3105,12 @@ Lbry.connect = function () { return Lbry.connectPromise; }; -Lbry.getMediaType = function (contentType, extname) { - if (extname) { - var formats = [[/^(mp4|m4v|webm|flv|f4v|ogv)$/i, 'video'], [/^(mp3|m4a|aac|wav|flac|ogg|opus)$/i, 'audio'], [/^(html|htm|xml|pdf|odf|doc|docx|md|markdown|txt|epub|org)$/i, 'document'], [/^(stl|obj|fbx|gcode)$/i, '3D-file']]; +Lbry.getMediaType = function (contentType, fileName) { + if (contentType) { + return (/^[^/]+/.exec(contentType)[0] + ); + } else if (fileName) { + var formats = [[/^.+\.(mp4|m4v|webm|flv|f4v|ogv)$/i, 'video'], [/^.+\.(mp3|m4a|aac|wav|flac|ogg|opus)$/i, 'audio'], [/^.+\.(html|htm|xml|pdf|odf|doc|docx|md|markdown|txt|epub|org)$/i, 'document'], [/^.+\.(stl|obj|fbx|gcode)$/i, '3D-file']]; var res = formats.reduce(function (ret, testpair) { switch (testpair[0].test(ret)) { case true: @@ -3281,11 +3118,8 @@ Lbry.getMediaType = function (contentType, extname) { default: return ret; } - }, extname); - return res === extname ? 'unknown' : res; - } else if (contentType) { - return (/^[^/]+/.exec(contentType)[0] - ); + }, fileName); + return res === fileName ? 'unknown' : res; } return 'unknown'; }; @@ -3543,26 +3377,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; /***/ }), @@ -4065,18 +3899,14 @@ var objectKeys = Object.keys || function (obj) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeSelectRecommendedContentForUri = exports.makeSelectNsfwCountForChannel = exports.makeSelectNsfwCountFromUris = exports.selectRewardContentClaimIds = exports.makeSelectTotalPagesForChannel = exports.makeSelectTotalItemsForChannel = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = exports.selectTrendingUris = exports.selectFetchingFeaturedUris = exports.selectFeaturedUris = exports.makeSelectIsUriResolving = exports.selectResolvingUris = exports.selectMyChannelClaims = exports.selectFetchingMyChannels = exports.selectMyClaimsOutpoints = exports.selectAllMyClaimsByOutpoint = exports.selectMyClaimsWithoutChannels = exports.selectMyClaims = exports.selectPendingClaims = exports.selectIsFetchingClaimListMine = exports.makeSelectContentTypeForUri = exports.makeSelectTitleForUri = exports.makeSelectMetadataForUri = exports.makeSelectClaimsInChannelForCurrentPage = exports.makeSelectClaimsInChannelForPage = exports.makeSelectFetchingChannelClaims = exports.selectAllFetchingChannelClaims = exports.makeSelectClaimIsMine = exports.selectMyActiveClaims = exports.selectAbandoningIds = exports.selectMyClaimsRaw = exports.makeSelectClaimForUri = exports.selectAllClaimsByChannel = exports.selectClaimsByUri = exports.selectClaimsById = undefined; +exports.selectRewardContentClaimIds = exports.makeSelectTotalPagesForChannel = exports.makeSelectTotalItemsForChannel = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = exports.selectTrendingUris = exports.selectFetchingFeaturedUris = exports.selectFeaturedUris = exports.makeSelectIsUriResolving = exports.selectResolvingUris = exports.selectMyChannelClaims = exports.selectFetchingMyChannels = exports.selectMyClaimsOutpoints = exports.selectAllMyClaimsByOutpoint = exports.selectMyClaimsWithoutChannels = exports.selectMyClaims = exports.selectPendingClaims = exports.selectIsFetchingClaimListMine = exports.makeSelectContentTypeForUri = exports.makeSelectTitleForUri = exports.makeSelectMetadataForUri = exports.makeSelectClaimsInChannelForCurrentPage = exports.makeSelectClaimsInChannelForPage = exports.makeSelectFetchingChannelClaims = exports.selectAllFetchingChannelClaims = exports.makeSelectClaimIsMine = exports.selectMyActiveClaims = exports.selectAbandoningIds = exports.selectMyClaimsRaw = exports.makeSelectClaimForUri = exports.selectAllClaimsByChannel = exports.selectClaimsByUri = exports.selectClaimsById = undefined; var _lbryURI = __webpack_require__(2); var _navigation = __webpack_require__(15); -var _search = __webpack_require__(18); - var _reselect = __webpack_require__(16); -var _claim = __webpack_require__(20); - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var selectState = function selectState(state) { @@ -4251,7 +4081,7 @@ var selectMyChannelClaims = exports.selectMyChannelClaims = (0, _reselect.create ids.forEach(function (id) { if (byId[id]) { - // I'm not sure why this check is necessary, but it ought to be a quick fix for https://github.com/lbryio/lbry-desktop/issues/544 + // I'm not sure why this check is necessary, but it ought to be a quick fix for https://github.com/lbryio/lbry-app/issues/544 claims.push(byId[id]); } }); @@ -4309,64 +4139,6 @@ var selectRewardContentClaimIds = exports.selectRewardContentClaimIds = (0, _res return state.rewardedContentClaimIds; }); -var makeSelectNsfwCountFromUris = exports.makeSelectNsfwCountFromUris = function makeSelectNsfwCountFromUris(uris) { - return (0, _reselect.createSelector)(selectClaimsByUri, function (claims) { - return uris.reduce(function (acc, uri) { - var claim = claims[uri]; - if ((0, _claim.isClaimNsfw)(claim)) { - return acc + 1; - } - return acc; - }, 0); - }); -}; - -var makeSelectNsfwCountForChannel = exports.makeSelectNsfwCountForChannel = function makeSelectNsfwCountForChannel(uri) { - var pageSelector = (0, _navigation.makeSelectCurrentParam)('page'); - - return (0, _reselect.createSelector)(selectClaimsById, selectAllClaimsByChannel, pageSelector, function (byId, allClaims, page) { - var byChannel = allClaims[uri] || {}; - var claimIds = byChannel[page || 1]; - - if (!claimIds) return 0; - - return claimIds.reduce(function (acc, claimId) { - var claim = byId[claimId]; - if ((0, _claim.isClaimNsfw)(claim)) { - return acc + 1; - } - return acc; - }, 0); - }); -}; - -var makeSelectRecommendedContentForUri = exports.makeSelectRecommendedContentForUri = function makeSelectRecommendedContentForUri(uri) { - return (0, _reselect.createSelector)(makeSelectClaimForUri(uri), _search.selectSearchUrisByQuery, function (claim, searchUrisByQuery) { - var atVanityURI = !uri.includes('#'); - - var recommendedContent = void 0; - if (claim) { - var title = claim.value.stream.metadata.title; - - var searchUris = searchUrisByQuery[title.replace(/\//, ' ')]; - if (searchUris) { - // If we are at a vanity uri, we can't do a uri match - // The first search result _should_ be the same as the claim a user is on - if (atVanityURI) { - searchUris = searchUris.slice(1); - } - - searchUris = searchUris.filter(function (searchUri) { - return searchUri !== uri; - }); - recommendedContent = searchUris; - } - } - - return recommendedContent; - }); -}; - /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { @@ -4757,178 +4529,6 @@ function toQueryString(params) { "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.selectSearchSuggestions = exports.selectSearchBarFocused = exports.selectWunderBarAddress = exports.makeSelectSearchUris = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchQuery = exports.selectSuggestions = exports.selectSearchValue = exports.selectState = undefined; - -var _search = __webpack_require__(19); - -var SEARCH_TYPES = _interopRequireWildcard(_search); - -var _lbryURI = __webpack_require__(2); - -var _navigation = __webpack_require__(15); - -var _reselect = __webpack_require__(16); - -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 selectState = exports.selectState = function selectState(state) { - return state.search || {}; -}; - -var selectSearchValue = exports.selectSearchValue = (0, _reselect.createSelector)(selectState, function (state) { - return state.searchQuery; -}); - -var selectSuggestions = exports.selectSuggestions = (0, _reselect.createSelector)(selectState, function (state) { - return state.suggestions; -}); - -var selectSearchQuery = exports.selectSearchQuery = (0, _reselect.createSelector)(_navigation.selectCurrentPage, _navigation.selectCurrentParams, function (page, params) { - return page === 'search' ? params && params.query : null; -}); - -var selectIsSearching = exports.selectIsSearching = (0, _reselect.createSelector)(selectState, function (state) { - return state.searching; -}); - -var selectSearchUrisByQuery = exports.selectSearchUrisByQuery = (0, _reselect.createSelector)(selectState, function (state) { - return state.urisByQuery; -}); - -var makeSelectSearchUris = exports.makeSelectSearchUris = function makeSelectSearchUris(query) { - return ( - // replace statement below is kind of ugly, and repeated in doSearch action - (0, _reselect.createSelector)(selectSearchUrisByQuery, function (byQuery) { - return byQuery[query ? query.replace(/^lbry:\/\//i, '').replace(/\//, ' ') : query]; - }) - ); -}; - -var selectWunderBarAddress = exports.selectWunderBarAddress = (0, _reselect.createSelector)(_navigation.selectCurrentPage, selectSearchQuery, _navigation.selectCurrentParams, function (page, query, params) { - // only populate the wunderbar address if we are on the file/channel pages - // or show the search query - if (page === 'show') { - return params.uri; - } - return query; -}); - -var selectSearchBarFocused = exports.selectSearchBarFocused = (0, _reselect.createSelector)(selectState, function (state) { - return state.focused; -}); -// export const selectSear - -var selectSearchSuggestions = exports.selectSearchSuggestions = (0, _reselect.createSelector)(selectSearchValue, selectSuggestions, function (query, suggestions) { - if (!query) { - return []; - } - - var queryIsPrefix = query === 'lbry:' || query === 'lbry:/' || query === 'lbry://'; - - if (query.startsWith('lbry://') && query !== 'lbry://') { - // If it starts with a prefix, don't show any autocomplete results - // They are probably typing/pasting in a lbry uri - return [{ - value: query, - type: SEARCH_TYPES.FILE - }]; - } else if (queryIsPrefix) { - // If it is a prefix, wait until something else comes to figure out what to do - return []; - } - - var searchSuggestions = []; - try { - var uri = (0, _lbryURI.normalizeURI)(query); - - var _parseURI = (0, _lbryURI.parseURI)(uri), - claimName = _parseURI.claimName, - isChannel = _parseURI.isChannel; - - searchSuggestions.push({ - value: claimName, - type: SEARCH_TYPES.SEARCH - }, { - value: uri, - shorthand: isChannel ? claimName.slice(1) : claimName, - type: isChannel ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE - }); - } catch (e) { - searchSuggestions.push({ - value: query, - type: SEARCH_TYPES.SEARCH - }); - } - - var apiSuggestions = suggestions[query] || []; - if (apiSuggestions.length) { - searchSuggestions = searchSuggestions.concat(apiSuggestions.filter(function (suggestion) { - return suggestion !== query; - }).map(function (suggestion) { - // determine if it's a channel - try { - var _uri = (0, _lbryURI.normalizeURI)(suggestion); - - var _parseURI2 = (0, _lbryURI.parseURI)(_uri), - _claimName = _parseURI2.claimName, - _isChannel = _parseURI2.isChannel; - - return { - value: _uri, - shorthand: _isChannel ? _claimName.slice(1) : _claimName, - type: _isChannel ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE - }; - } catch (e) { - // search result includes some character that isn't valid in claim names - return { - value: suggestion, - type: SEARCH_TYPES.SEARCH - }; - } - })); - } - - return searchSuggestions; -}); - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var FILE = exports.FILE = 'file'; -var CHANNEL = exports.CHANNEL = 'channel'; -var SEARCH = exports.SEARCH = 'search'; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var isClaimNsfw = exports.isClaimNsfw = function isClaimNsfw(claim) { - return claim && claim.value && claim.value.stream && claim.value.stream.metadata.nsfw; -}; - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -4946,7 +4546,7 @@ function batchActions() { } /***/ }), -/* 22 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5006,7 +4606,7 @@ function doFetchCostInfoForUri(uri) { } /***/ }), -/* 23 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5031,7 +4631,7 @@ var _claims = __webpack_require__(5); var _claims2 = __webpack_require__(14); -var _file_info = __webpack_require__(24); +var _file_info = __webpack_require__(21); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5099,7 +4699,7 @@ function doFetchFileInfosAndPublishedClaims() { } /***/ }), -/* 24 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5306,7 +4906,7 @@ var selectSearchDownloadUris = exports.selectSearchDownloadUris = function selec }; /***/ }), -/* 25 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5321,15 +4921,19 @@ var _action_types = __webpack_require__(4); var ACTIONS = _interopRequireWildcard(_action_types); +var _search = __webpack_require__(23); + +var SEARCH_TYPES = _interopRequireWildcard(_search); + var _lbryURI = __webpack_require__(2); var _claims = __webpack_require__(5); -var _search = __webpack_require__(18); +var _search2 = __webpack_require__(24); -var _batchActions = __webpack_require__(21); +var _batchActions = __webpack_require__(18); -var _handleFetch = __webpack_require__(26); +var _handleFetch = __webpack_require__(25); var _handleFetch2 = _interopRequireDefault(_handleFetch); @@ -5337,17 +4941,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } } -// @flow -var DEFAULTSEARCHRESULTSIZE = 10; +var DEFAULTSEARCHRESULTSIZE = 10; // @flow + var DEFAULTSEARCHRESULTFROM = 0; var doSearch = exports.doSearch = function doSearch(rawQuery) { var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULTSEARCHRESULTSIZE; var from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULTSEARCHRESULTFROM; - var isBackgroundSearch = arguments[3]; return function (dispatch, getState) { var state = getState(); - var query = rawQuery.replace(/^lbry:\/\//i, '').replace(/\//, ' '); + var query = rawQuery.replace(/^lbry:\/\//i, ''); if (!query) { dispatch({ @@ -5357,7 +4960,7 @@ var doSearch = exports.doSearch = function doSearch(rawQuery) { } // If we have already searched for something, we don't need to do anything - var urisForQuery = (0, _search.makeSelectSearchUris)(query)(state); + var urisForQuery = (0, _search2.makeSelectSearchUris)(query)(state); if (urisForQuery && !!urisForQuery.length) { return; } @@ -5369,17 +4972,13 @@ var doSearch = exports.doSearch = function doSearch(rawQuery) { // If the user is on the file page with a pre-populated uri and they select // the search option without typing anything, searchQuery will be empty // We need to populate it so the input is filled on the search page - // isBackgroundSearch means the search is happening in the background, don't update the search query - if (!state.search.searchQuery && !isBackgroundSearch) { + if (!state.search.searchQuery) { dispatch({ type: ACTIONS.UPDATE_SEARCH_QUERY, data: { searchQuery: query } }); } - - // For some reason the app doesn't automatically encode the pound sign (#) - // If we don't do it manually everything after the '#' gets removed - fetch('https://lighthouse.lbry.io/search?s=' + query.replace('#', '%23') + '&size=' + size + '&from=' + from).then(_handleFetch2.default).then(function (data) { + fetch('https://lighthouse.lbry.io/search?s=' + query + '&size=' + size + '&from=' + from).then(_handleFetch2.default).then(function (data) { var uris = []; var actions = []; @@ -5409,29 +5008,103 @@ var doSearch = exports.doSearch = function doSearch(rawQuery) { }; var getSearchSuggestions = exports.getSearchSuggestions = function getSearchSuggestions(value /*: string*/) { - return function (dispatch, getState) { + return function (dispatch) { var query = value.trim(); + var isPrefix = function isPrefix() { + return query === '@' || query === 'lbry:' || query === 'lbry:/' || query === 'lbry://'; + }; + + if (!query || isPrefix()) { + dispatch({ + type: ACTIONS.UPDATE_SEARCH_SUGGESTIONS, + data: { suggestions: [] } + }); + return; + } + + var suggestions = []; + try { + // If the user is about to manually add the claim id ignore it until they + // actually add one. This would hardly ever happen, but then the search + // suggestions won't change just from adding a '#' after a uri + var uriQuery = query; + if (uriQuery.endsWith('#')) { + uriQuery = uriQuery.slice(0, -1); + } + + var uri = (0, _lbryURI.normalizeURI)(uriQuery); + + var _parseURI = (0, _lbryURI.parseURI)(uri), + claimName = _parseURI.claimName, + isChannel = _parseURI.isChannel; + + suggestions.push({ + value: uri, + shorthand: isChannel ? claimName.slice(1) : claimName, + type: isChannel ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE + }, { + value: claimName, + type: SEARCH_TYPES.SEARCH + }); + } catch (e) { + suggestions.push({ + value: query, + type: SEARCH_TYPES.SEARCH + }); + } + + // Populate the current search query suggestion before fetching results + dispatch({ + type: ACTIONS.UPDATE_SEARCH_SUGGESTIONS, + data: { suggestions: suggestions } + }); + // strip out any basic stuff for more accurate search results - var searchValue = query.replace(/lbry:\/\//g, '').replace(/-/g, ' '); + var searchValue = value.replace(/lbry:\/\//g, '').replace(/-/g, ' '); if (searchValue.includes('#')) { // This should probably be more robust, but I think it's fine for now // Remove everything after # to get rid of the claim id searchValue = searchValue.substring(0, searchValue.indexOf('#')); } - var suggestions = (0, _search.selectSuggestions)(getState()); - if (suggestions[searchValue]) { - return; - } - fetch('https://lighthouse.lbry.io/autocomplete?s=' + searchValue).then(_handleFetch2.default).then(function (apiSuggestions) { + // Suggestion could be a channel, uri, or search term + var formattedSuggestions = apiSuggestions.slice(0, 6).filter(function (suggestion) { + return suggestion !== query; + }).map(function (suggestion) { + if (suggestion.includes(' ')) { + return { + value: suggestion, + type: SEARCH_TYPES.SEARCH + }; + } + + try { + var _uri = (0, _lbryURI.normalizeURI)(suggestion); + + var _parseURI2 = (0, _lbryURI.parseURI)(_uri), + _claimName = _parseURI2.claimName, + _isChannel = _parseURI2.isChannel; + + return { + value: _uri, + shorthand: _isChannel ? _claimName.slice(1) : _claimName, + type: _isChannel ? SEARCH_TYPES.CHANNEL : SEARCH_TYPES.FILE + }; + } catch (e) { + // search result includes some character that isn't valid in claim names + return { + value: suggestion, + type: SEARCH_TYPES.SEARCH + }; + } + }); + + suggestions = suggestions.concat(formattedSuggestions); dispatch({ type: ACTIONS.UPDATE_SEARCH_SUGGESTIONS, - data: { - query: searchValue, - suggestions: apiSuggestions - } + data: { suggestions: suggestions } }); }).catch(function () { // If the fetch fails, do nothing @@ -5471,7 +5144,79 @@ var doBlurSearchInput = exports.doBlurSearchInput = function doBlurSearchInput() }; /***/ }), -/* 26 */ +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var FILE = exports.FILE = 'file'; +var CHANNEL = exports.CHANNEL = 'channel'; +var SEARCH = exports.SEARCH = 'search'; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.selectSearchBarFocused = exports.selectWunderBarAddress = exports.makeSelectSearchUris = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchQuery = exports.selectSearchValue = exports.selectState = undefined; + +var _navigation = __webpack_require__(15); + +var _reselect = __webpack_require__(16); + +var selectState = exports.selectState = function selectState(state) { + return state.search || {}; +}; + +var selectSearchValue = exports.selectSearchValue = (0, _reselect.createSelector)(selectState, function (state) { + return state.searchQuery; +}); + +var selectSearchQuery = exports.selectSearchQuery = (0, _reselect.createSelector)(_navigation.selectCurrentPage, _navigation.selectCurrentParams, function (page, params) { + return page === 'search' ? params && params.query : null; +}); + +var selectIsSearching = exports.selectIsSearching = (0, _reselect.createSelector)(selectState, function (state) { + return state.searching; +}); + +var selectSearchUrisByQuery = exports.selectSearchUrisByQuery = (0, _reselect.createSelector)(selectState, function (state) { + return state.urisByQuery; +}); + +var makeSelectSearchUris = exports.makeSelectSearchUris = function makeSelectSearchUris(query) { + return ( + // replace statement below is kind of ugly, and repeated in doSearch action + (0, _reselect.createSelector)(selectSearchUrisByQuery, function (byQuery) { + return byQuery[query ? query.replace(/^lbry:\/\//i, '') : query]; + }) + ); +}; + +var selectWunderBarAddress = exports.selectWunderBarAddress = (0, _reselect.createSelector)(_navigation.selectCurrentPage, selectSearchQuery, _navigation.selectCurrentParams, function (page, query, params) { + // only populate the wunderbar address if we are on the file/channel pages + // or show the search query + if (page === 'show') { + return params.uri; + } + return query; +}); + +var selectSearchBarFocused = exports.selectSearchBarFocused = (0, _reselect.createSelector)(selectState, function (state) { + return state.focused; +}); + +/***/ }), +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5486,7 +5231,7 @@ function handleFetchResponse(response) { } /***/ }), -/* 27 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5569,7 +5314,7 @@ function doBlackListedOutpointsSubscribe() { } /***/ }), -/* 28 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5588,11 +5333,6 @@ exports.doSendDraftTransaction = doSendDraftTransaction; exports.doSetDraftTransactionAmount = doSetDraftTransactionAmount; exports.doSetDraftTransactionAddress = doSetDraftTransactionAddress; exports.doSendSupport = doSendSupport; -exports.doWalletEncrypt = doWalletEncrypt; -exports.doWalletUnlock = doWalletUnlock; -exports.doWalletLock = doWalletLock; -exports.doWalletDecrypt = doWalletDecrypt; -exports.doWalletStatus = doWalletStatus; var _action_types = __webpack_require__(4); @@ -5604,7 +5344,7 @@ var _lbry2 = _interopRequireDefault(_lbry); var _notifications = __webpack_require__(3); -var _wallet = __webpack_require__(29); +var _wallet = __webpack_require__(28); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5838,113 +5578,8 @@ function doSendSupport(amount, claimId, uri, successCallback, errorCallback) { }; } -function doWalletEncrypt(newPassword) { - return function (dispatch) { - dispatch({ - type: ACTIONS.WALLET_ENCRYPT_START - }); - - _lbry2.default.wallet_encrypt({ new_password: newPassword }).then(function (result) { - if (result === true) { - dispatch({ - type: ACTIONS.WALLET_ENCRYPT_COMPLETED, - result: result - }); - } else { - dispatch({ - type: ACTIONS.WALLET_ENCRYPT_FAILED, - result: result - }); - } - }); - }; -} - -function doWalletUnlock(password) { - return function (dispatch) { - dispatch({ - type: ACTIONS.WALLET_UNLOCK_START - }); - - _lbry2.default.wallet_unlock({ password: password }).then(function (result) { - if (result === true) { - dispatch({ - type: ACTIONS.WALLET_UNLOCK_COMPLETED, - result: result - }); - } else { - dispatch({ - type: ACTIONS.WALLET_UNLOCK_FAILED, - result: result - }); - } - }); - }; -} - -function doWalletLock() { - return function (dispatch) { - dispatch({ - type: ACTIONS.WALLET_LOCK_START - }); - - _lbry2.default.wallet_lock().then(function (result) { - if (result === true) { - dispatch({ - type: ACTIONS.WALLET_LOCK_COMPLETED, - result: result - }); - } else { - dispatch({ - type: ACTIONS.WALLET_LOCK_FAILED, - result: result - }); - } - }); - }; -} - -function doWalletDecrypt() { - return function (dispatch) { - dispatch({ - type: ACTIONS.WALLET_DECRYPT_START - }); - - _lbry2.default.wallet_decrypt().then(function (result) { - if (result === true) { - dispatch({ - type: ACTIONS.WALLET_DECRYPT_COMPLETED, - result: result - }); - } else { - dispatch({ - type: ACTIONS.WALLET_DECRYPT_FAILED, - result: result - }); - } - }); - }; -} - -function doWalletStatus() { - return function (dispatch) { - dispatch({ - type: ACTIONS.WALLET_STATUS_START - }); - - _lbry2.default.status().then(function (status) { - if (status && status.wallet) { - dispatch({ - type: ACTIONS.WALLET_STATUS_COMPLETED, - result: status.wallet.is_encrypted - }); - } - }); - }; -} - /***/ }), -/* 29 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5953,76 +5588,16 @@ 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.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.selectState = undefined; var _reselect = __webpack_require__(16); -var _transaction_types = __webpack_require__(30); - -var TRANSACTIONS = _interopRequireWildcard(_transaction_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; } } - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var selectState = exports.selectState = function selectState(state) { return state.wallet || {}; }; -var selectWalletState = exports.selectWalletState = selectState; - -var selectWalletIsEncrypted = exports.selectWalletIsEncrypted = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletIsEncrypted; -}); - -var selectWalletEncryptPending = exports.selectWalletEncryptPending = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletEncryptPending; -}); - -var selectWalletEncryptSucceeded = exports.selectWalletEncryptSucceeded = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletEncryptSucceded; -}); - -var selectWalletEncryptResult = exports.selectWalletEncryptResult = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletEncryptResult; -}); - -var selectWalletDecryptPending = exports.selectWalletDecryptPending = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletDecryptPending; -}); - -var selectWalletDecryptSucceeded = exports.selectWalletDecryptSucceeded = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletDecryptSucceded; -}); - -var selectWalletDecryptResult = exports.selectWalletDecryptResult = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletDecryptResult; -}); - -var selectWalletUnlockPending = exports.selectWalletUnlockPending = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletUnlockPending; -}); - -var selectWalletUnlockSucceeded = exports.selectWalletUnlockSucceeded = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletUnlockSucceded; -}); - -var selectWalletUnlockResult = exports.selectWalletUnlockResult = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletUnlockResult; -}); - -var selectWalletLockPending = exports.selectWalletLockPending = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletLockPending; -}); - -var selectWalletLockSucceeded = exports.selectWalletLockSucceeded = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletLockSucceded; -}); - -var selectWalletLockResult = exports.selectWalletLockResult = (0, _reselect.createSelector)(selectState, function (state) { - return state.walletLockResult; -}); - var selectBalance = exports.selectBalance = (0, _reselect.createSelector)(selectState, function (state) { return state.balance; }); @@ -6039,7 +5614,7 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea // ignore dust/fees // 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 && tx.abandon_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) { return; } @@ -6047,24 +5622,21 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea append.push.apply(append, _toConsumableArray(tx.claim_info.map(function (item) { return Object.assign({}, tx, item, { - type: item.claim_name[0] === '@' ? TRANSACTIONS.CHANNEL : TRANSACTIONS.PUBLISH + type: item.claim_name[0] === '@' ? 'channel' : 'publish' }); }))); append.push.apply(append, _toConsumableArray(tx.support_info.map(function (item) { return Object.assign({}, tx, item, { - type: !item.is_tip ? TRANSACTIONS.SUPPORT : TRANSACTIONS.TIP + type: !item.is_tip ? 'support' : 'tip' }); }))); append.push.apply(append, _toConsumableArray(tx.update_info.map(function (item) { - return Object.assign({}, tx, item, { type: TRANSACTIONS.UPDATE }); - }))); - append.push.apply(append, _toConsumableArray(tx.abandon_info.map(function (item) { - return Object.assign({}, tx, item, { type: TRANSACTIONS.ABANDON }); + return Object.assign({}, tx, item, { type: 'update' }); }))); if (!append.length) { append.push(Object.assign({}, tx, { - type: tx.value < 0 ? TRANSACTIONS.SPEND : TRANSACTIONS.RECEIVE + type: tx.value < 0 ? 'spend' : 'receive' })); } @@ -6080,7 +5652,7 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea fee: amount < 0 ? -1 * tx.fee / append.length : 0, claim_id: item.claim_id, claim_name: item.claim_name, - type: item.type || TRANSACTIONS.SPEND, + type: item.type || 'send', nout: item.nout }; }))); @@ -6143,27 +5715,7 @@ var makeSelectBlockDate = exports.makeSelectBlockDate = function makeSelectBlock }; /***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// eslint-disable-next-line import/prefer-default-export -var SPEND = exports.SPEND = 'spend'; -var RECEIVE = exports.RECEIVE = 'receive'; -var PUBLISH = exports.PUBLISH = 'publish'; -var CHANNEL = exports.CHANNEL = 'channel'; -var TIP = exports.TIP = 'tip'; -var SUPPORT = exports.SUPPORT = 'support'; -var UPDATE = exports.UPDATE = 'update'; -var ABANDON = exports.ABANDON = 'abandon'; - -/***/ }), -/* 31 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6201,7 +5753,7 @@ function formatFullPrice(amount) { } /***/ }), -/* 32 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6371,14 +5923,12 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = function (state, action) { var currentPageClaimIds = []; var byId = Object.assign({}, state.byId); var fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims); - var claimsByUri = Object.assign({}, state.claimsByUri); if (claims !== undefined) { claims.forEach(function (claim) { allClaimIds.add(claim.claim_id); currentPageClaimIds.push(claim.claim_id); byId[claim.claim_id] = claim; - claimsByUri['lbry://' + claim.name + '#' + claim.claim_id] = claim.claim_id; }); } @@ -6390,8 +5940,7 @@ reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED] = function (state, action) { return Object.assign({}, state, { claimsByChannel: claimsByChannel, byId: byId, - fetchingChannelClaims: fetchingChannelClaims, - claimsByUri: claimsByUri + fetchingChannelClaims: fetchingChannelClaims }); }; @@ -6531,7 +6080,7 @@ function claimsReducer() { } /***/ }), -/* 33 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6589,7 +6138,7 @@ function costInfoReducer() { } /***/ }), -/* 34 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6598,9 +6147,6 @@ function costInfoReducer() { Object.defineProperty(exports, "__esModule", { value: true }); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - exports.fileInfoReducer = fileInfoReducer; var _action_types = __webpack_require__(4); @@ -6747,14 +6293,11 @@ reducers[ACTIONS.LOADING_VIDEO_STARTED] = function (state, action) { var newLoading = Object.assign({}, state.urisLoading); + newLoading[uri] = true; - var newErrors = _extends({}, state.errors); - if (uri in newErrors) delete newErrors[uri]; - return Object.assign({}, state, { - urisLoading: newLoading, - errors: _extends({}, newErrors) + urisLoading: newLoading }); }; @@ -6763,14 +6306,11 @@ reducers[ACTIONS.LOADING_VIDEO_FAILED] = function (state, action) { var newLoading = Object.assign({}, state.urisLoading); + delete newLoading[uri]; - var newErrors = _extends({}, state.errors); - newErrors[uri] = true; - return Object.assign({}, state, { - urisLoading: newLoading, - errors: _extends({}, newErrors) + urisLoading: newLoading }); }; @@ -6795,7 +6335,7 @@ function fileInfoReducer() { } /***/ }), -/* 35 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6810,7 +6350,7 @@ var _action_types = __webpack_require__(4); var ACTIONS = _interopRequireWildcard(_action_types); -var _modal_types = __webpack_require__(36); +var _modal_types = __webpack_require__(34); var MODALS = _interopRequireWildcard(_modal_types); @@ -6881,7 +6421,7 @@ function notificationsReducer() { } /***/ }), -/* 36 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6915,12 +6455,9 @@ var PUBLISH = exports.PUBLISH = 'publish'; var SEARCH = exports.SEARCH = 'search'; var CONFIRM_TRANSACTION = exports.CONFIRM_TRANSACTION = 'confirm_transaction'; var CONFIRM_THUMBNAIL_UPLOAD = exports.CONFIRM_THUMBNAIL_UPLOAD = 'confirm_thumbnail_upload'; -var WALLET_ENCRYPT = exports.WALLET_ENCRYPT = 'wallet_encrypt'; -var WALLET_DECRYPT = exports.WALLET_DECRYPT = 'wallet_decrypt'; -var WALLET_UNLOCK = exports.WALLET_UNLOCK = 'wallet_unlock'; /***/ }), -/* 37 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6940,7 +6477,7 @@ var _action_types = __webpack_require__(4); var ACTIONS = _interopRequireWildcard(_action_types); -var _reduxUtils = __webpack_require__(38); +var _reduxUtils = __webpack_require__(36); 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; } } @@ -6967,7 +6504,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope /*:: type UpdateSearchSuggestions = { type: ACTIONS.UPDATE_SEARCH_SUGGESTIONS, data: { - query: string, suggestions: Array, }, };*/ @@ -6991,7 +6527,7 @@ var defaultState = { isActive: false, // does the user have any typed text in the search input focused: false, // is the search input focused searchQuery: '', // needs to be an empty string for input focusing - suggestions: {}, + suggestions: [], urisByQuery: {} }; @@ -7020,15 +6556,15 @@ var searchReducer = exports.searchReducer = (0, _reduxUtils.handleActions)((_han }); }), _defineProperty(_handleActions, ACTIONS.UPDATE_SEARCH_SUGGESTIONS, function (state /*: SearchState*/, action /*: UpdateSearchSuggestions*/) /*: SearchState*/ { return _extends({}, state, { - suggestions: _extends({}, state.suggestions, _defineProperty({}, action.data.query, action.data.suggestions)) + suggestions: action.data.suggestions }); }), _defineProperty(_handleActions, ACTIONS.HISTORY_NAVIGATE, function (state /*: SearchState*/, action /*: HistoryNavigate*/) /*: SearchState*/ { var url = action.data.url; return _extends({}, state, { searchQuery: url.indexOf('/search') === 0 ? url.slice(14) : '', - isActive: url.indexOf('/search') === 0, - suggestions: {} + suggestions: [], + isActive: url.indexOf('/search') === 0 }); }), _defineProperty(_handleActions, ACTIONS.DISMISS_NOTIFICATION, function (state /*: SearchState*/) /*: SearchState*/ { return _extends({}, state, { @@ -7045,7 +6581,7 @@ var searchReducer = exports.searchReducer = (0, _reduxUtils.handleActions)((_han }), _handleActions), defaultState); /***/ }), -/* 38 */ +/* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7078,7 +6614,7 @@ var handleActions = exports.handleActions = function handleActions(actionMap, de }; /***/ }), -/* 39 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7095,8 +6631,7 @@ 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 = {}; // @flow - +var reducers = {}; var buildDraftTransaction = function buildDraftTransaction() { return { amount: undefined, @@ -7104,36 +6639,6 @@ var buildDraftTransaction = function buildDraftTransaction() { }; }; -// TODO: Split into common success and failure types -// See details in https://github.com/lbryio/lbry/issues/1307 -/*:: type ActionResult = { - type: any, - result: any, -};*/ -/*:: type WalletState = { - balance: any, - blocks: any, - transactions: any, - fetchingTransactions: boolean, - gettingNewAddress: boolean, - draftTransaction: any, - sendingSupport: boolean, - walletIsEncrypted: boolean, - walletEncryptPending: boolean, - walletEncryptSucceded: ?boolean, - walletEncryptResult: ?boolean, - walletDecryptPending: boolean, - walletDecryptSucceded: ?boolean, - walletDecryptResult: ?boolean, - walletUnlockPending: boolean, - walletUnlockSucceded: ?boolean, - walletUnlockResult: ?boolean, - walletLockPending: boolean, - walletLockSucceded: ?boolean, - walletLockResult: ?boolean, -};*/ - - var defaultState = { balance: undefined, blocks: {}, @@ -7141,29 +6646,16 @@ var defaultState = { fetchingTransactions: false, gettingNewAddress: false, draftTransaction: buildDraftTransaction(), - sendingSupport: false, - walletIsEncrypted: false, - walletEncryptPending: false, - walletEncryptSucceded: null, - walletEncryptResult: null, - walletDecryptPending: false, - walletDecryptSucceded: null, - walletDecryptResult: null, - walletUnlockPending: false, - walletUnlockSucceded: null, - walletUnlockResult: null, - walletLockPending: false, - walletLockSucceded: null, - walletLockResult: null + sendingSupport: false }; -reducers[ACTIONS.FETCH_TRANSACTIONS_STARTED] = function (state /*: WalletState*/) { +reducers[ACTIONS.FETCH_TRANSACTIONS_STARTED] = function (state) { return Object.assign({}, state, { fetchingTransactions: true }); }; -reducers[ACTIONS.FETCH_TRANSACTIONS_COMPLETED] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.FETCH_TRANSACTIONS_COMPLETED] = function (state, action) { var byId = Object.assign({}, state.transactions); var transactions = action.data.transactions; @@ -7179,13 +6671,13 @@ reducers[ACTIONS.FETCH_TRANSACTIONS_COMPLETED] = function (state /*: WalletState }); }; -reducers[ACTIONS.GET_NEW_ADDRESS_STARTED] = function (state /*: WalletState*/) { +reducers[ACTIONS.GET_NEW_ADDRESS_STARTED] = function (state) { return Object.assign({}, state, { gettingNewAddress: true }); }; -reducers[ACTIONS.GET_NEW_ADDRESS_COMPLETED] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.GET_NEW_ADDRESS_COMPLETED] = function (state, action) { var address = action.data.address; // Say no to localStorage! @@ -7196,25 +6688,25 @@ reducers[ACTIONS.GET_NEW_ADDRESS_COMPLETED] = function (state /*: WalletState*/, }); }; -reducers[ACTIONS.UPDATE_BALANCE] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.UPDATE_BALANCE] = function (state, action) { return Object.assign({}, state, { balance: action.data.balance }); }; -reducers[ACTIONS.CHECK_ADDRESS_IS_MINE_STARTED] = function (state /*: WalletState*/) { +reducers[ACTIONS.CHECK_ADDRESS_IS_MINE_STARTED] = function (state) { return Object.assign({}, state, { checkingAddressOwnership: true }); }; -reducers[ACTIONS.CHECK_ADDRESS_IS_MINE_COMPLETED] = function (state /*: WalletState*/) { +reducers[ACTIONS.CHECK_ADDRESS_IS_MINE_COMPLETED] = function (state) { return Object.assign({}, state, { checkingAddressOwnership: false }); }; -reducers[ACTIONS.SET_DRAFT_TRANSACTION_AMOUNT] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.SET_DRAFT_TRANSACTION_AMOUNT] = function (state, action) { var oldDraft = state.draftTransaction; var newDraft = Object.assign({}, oldDraft, { amount: parseFloat(action.data.amount) @@ -7225,7 +6717,7 @@ reducers[ACTIONS.SET_DRAFT_TRANSACTION_AMOUNT] = function (state /*: WalletState }); }; -reducers[ACTIONS.SET_DRAFT_TRANSACTION_ADDRESS] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.SET_DRAFT_TRANSACTION_ADDRESS] = function (state, action) { var oldDraft = state.draftTransaction; var newDraft = Object.assign({}, oldDraft, { address: action.data.address @@ -7236,7 +6728,7 @@ reducers[ACTIONS.SET_DRAFT_TRANSACTION_ADDRESS] = function (state /*: WalletStat }); }; -reducers[ACTIONS.SEND_TRANSACTION_STARTED] = function (state /*: WalletState*/) { +reducers[ACTIONS.SEND_TRANSACTION_STARTED] = function (state) { var newDraftTransaction = Object.assign({}, state.draftTransaction, { sending: true }); @@ -7246,13 +6738,13 @@ reducers[ACTIONS.SEND_TRANSACTION_STARTED] = function (state /*: WalletState*/) }); }; -reducers[ACTIONS.SEND_TRANSACTION_COMPLETED] = function (state /*: WalletState*/) { +reducers[ACTIONS.SEND_TRANSACTION_COMPLETED] = function (state) { return Object.assign({}, state, { draftTransaction: buildDraftTransaction() }); }; -reducers[ACTIONS.SEND_TRANSACTION_FAILED] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.SEND_TRANSACTION_FAILED] = function (state, action) { var newDraftTransaction = Object.assign({}, state.draftTransaction, { sending: false, error: action.data.error @@ -7263,26 +6755,26 @@ reducers[ACTIONS.SEND_TRANSACTION_FAILED] = function (state /*: WalletState*/, a }); }; -reducers[ACTIONS.SUPPORT_TRANSACTION_STARTED] = function (state /*: WalletState*/) { +reducers[ACTIONS.SUPPORT_TRANSACTION_STARTED] = function (state) { return Object.assign({}, state, { sendingSupport: true }); }; -reducers[ACTIONS.SUPPORT_TRANSACTION_COMPLETED] = function (state /*: WalletState*/) { +reducers[ACTIONS.SUPPORT_TRANSACTION_COMPLETED] = function (state) { return Object.assign({}, state, { sendingSupport: false }); }; -reducers[ACTIONS.SUPPORT_TRANSACTION_FAILED] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.SUPPORT_TRANSACTION_FAILED] = function (state, action) { return Object.assign({}, state, { error: action.data.error, sendingSupport: false }); }; -reducers[ACTIONS.FETCH_BLOCK_SUCCESS] = function (state /*: WalletState*/, action) { +reducers[ACTIONS.FETCH_BLOCK_SUCCESS] = function (state, action) { var _action$data = action.data, block = _action$data.block, height = _action$data.block.height; @@ -7294,108 +6786,6 @@ reducers[ACTIONS.FETCH_BLOCK_SUCCESS] = function (state /*: WalletState*/, actio return Object.assign({}, state, { blocks: blocks }); }; -reducers[ACTIONS.WALLET_STATUS_COMPLETED] = function (state /*: WalletState*/, action) { - return Object.assign({}, state, { - walletIsEncrypted: action.result - }); -}; - -reducers[ACTIONS.WALLET_ENCRYPT_START] = function (state /*: WalletState*/) { - return Object.assign({}, state, { - walletEncryptPending: true, - walletEncryptSucceded: null, - walletEncryptResult: null - }); -}; - -reducers[ACTIONS.WALLET_ENCRYPT_COMPLETED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletEncryptPending: false, - walletEncryptSucceded: true, - walletEncryptResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_ENCRYPT_FAILED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletEncryptPending: false, - walletEncryptSucceded: false, - walletEncryptResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_DECRYPT_START] = function (state /*: WalletState*/) { - return Object.assign({}, state, { - walletDecryptPending: true, - walletDecryptSucceded: null, - walletDecryptResult: null - }); -}; - -reducers[ACTIONS.WALLET_DECRYPT_COMPLETED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletDecryptPending: false, - walletDecryptSucceded: true, - walletDecryptResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_DECRYPT_FAILED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletDecryptPending: false, - walletDecryptSucceded: false, - walletDecryptResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_UNLOCK_START] = function (state /*: WalletState*/) { - return Object.assign({}, state, { - walletUnlockPending: true, - walletUnlockSucceded: null, - walletUnlockResult: null - }); -}; - -reducers[ACTIONS.WALLET_UNLOCK_COMPLETED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletUnlockPending: false, - walletUnlockSucceded: true, - walletUnlockResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_UNLOCK_FAILED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletUnlockPending: false, - walletUnlockSucceded: false, - walletUnlockResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_LOCK_START] = function (state /*: WalletState*/) { - return Object.assign({}, state, { - walletLockPending: false, - walletLockSucceded: null, - walletLockResult: null - }); -}; - -reducers[ACTIONS.WALLET_LOCK_COMPLETED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletLockPending: false, - walletLockSucceded: true, - walletLockResult: action.result - }); -}; - -reducers[ACTIONS.WALLET_LOCK_FAILED] = function (state /*: WalletState*/, action /*: ActionResult*/) { - return Object.assign({}, state, { - walletLockPending: false, - walletLockSucceded: false, - walletLockResult: action.result - }); -}; - function walletReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState; var action = arguments[1]; @@ -7406,7 +6796,7 @@ function walletReducer() { } /***/ }), -/* 40 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7425,7 +6815,7 @@ var _action_types = __webpack_require__(4); var ACTIONS = _interopRequireWildcard(_action_types); -var _reduxUtils = __webpack_require__(38); +var _reduxUtils = __webpack_require__(36); 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; } } @@ -7465,7 +6855,7 @@ var blacklistReducer = exports.blacklistReducer = (0, _reduxUtils.handleActions) }), _handleActions), defaultState); /***/ }), -/* 41 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7487,7 +6877,7 @@ var selectBlackListedOutpoints = exports.selectBlackListedOutpoints = (0, _resel }); /***/ }), -/* 42 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7527,7 +6917,7 @@ selectNotification, function (notification) { }); /***/ }), -/* 43 */ +/* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7571,7 +6961,7 @@ var makeSelectFetchingCostInfoForUri = exports.makeSelectFetchingCostInfoForUri }; /***/ }), -/* 44 */ +/* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7587,7 +6977,7 @@ var COMPLETE = exports.COMPLETE = 'complete'; var MANUAL = exports.MANUAL = 'manual'; /***/ }), -/* 45 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7885,11 +7275,13 @@ function doClaimRewardType(rewardType) { } if (!userIsRewardApproved && rewardType !== _rewards3.default.TYPE_CONFIRM_EMAIL) { - var action = (0, _lbryRedux.doNotify)({ - id: _lbryRedux.MODALS.REWARD_APPROVAL_REQUIRED, - isError: false - }); - dispatch(action); + if (!options || !options.failSilently) { + var action = (0, _lbryRedux.doNotify)({ + id: _lbryRedux.MODALS.REWARD_APPROVAL_REQUIRED, + isError: false + }); + dispatch(action); + } return; }