From 0b9980f371058c8d2fdf07cd62564d9aaf13fe2e Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Tue, 17 Jan 2017 05:06:39 -0500 Subject: [PATCH] Rename all vars called "___sInfo" to "___Infos" --- js/lbry.js | 10 +++++----- js/page/file-list.js | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/js/lbry.js b/js/lbry.js index 38df0564e..c0c4798d7 100644 --- a/js/lbry.js +++ b/js/lbry.js @@ -286,8 +286,8 @@ lbry.revealFile = function(path, callback) { lbry.getFileInfoWhenListed = function(name, callback, timeoutCallback, tryNum=0) { // Calls callback with file info when it appears in the list of files returned by lbry.getFilesInfo(). // If timeoutCallback is provided, it will be called if the file fails to appear. - lbry.getFilesInfo(function(filesInfo) { - for (var fileInfo of filesInfo) { + lbry.getFilesInfo(function(fileInfos) { + for (var fileInfo of fileInfos) { if (fileInfo.lbry_uri == name) { callback(fileInfo); return; @@ -468,8 +468,8 @@ lbry._removedFiles = []; lbry._claimIdOwnershipCache = {}; // should be claimId!!! But not lbry._updateClaimOwnershipCache = function(claimId) { - lbry.getMyClaims((claimsInfo) => { - lbry._claimIdOwnershipCache[claimId] = !!claimsInfo.reduce(function(match, claimInfo) { + lbry.getMyClaims((claimInfos) => { + lbry._claimIdOwnershipCache[claimId] = !!claimInfos.reduce(function(match, claimInfo) { return match || claimInfo.claim_id == claimId; }); }); @@ -520,4 +520,4 @@ lbry.fileInfoUnsubscribe = function(name, subscribeId) { delete lbry._fileInfoSubscribeCallbacks[name][subscribeId]; } -export default lbry; \ No newline at end of file +export default lbry; diff --git a/js/page/file-list.js b/js/page/file-list.js index 9b4a7674f..3cf51ee37 100644 --- a/js/page/file-list.js +++ b/js/page/file-list.js @@ -19,11 +19,11 @@ export let FileListDownloaded = React.createClass({ document.title = "Downloaded Files"; let publishedFilesSdHashes = []; - lbry.getMyClaims((claimsInfo) => { + lbry.getMyClaims((claimInfos) => { if (!this._isMounted) { return; } - for (let claimInfo of claimsInfo) { + for (let claimInfo of claimInfos) { let metadata = JSON.parse(claimInfo.value); publishedFilesSdHashes.push(metadata.sources.lbry_sd_hash); } @@ -74,23 +74,23 @@ export let FileListPublished = React.createClass({ this._isMounted = true; document.title = "Published Files"; - lbry.getMyClaims((claimsInfo) => { + lbry.getMyClaims((claimInfos) => { /** * Build newFileInfos as a sparse array and drop elements in at the same position they - * occur in claimsInfo, so the order is preserved even if the API calls inside this loop + * occur in claimInfos, so the order is preserved even if the API calls inside this loop * return out of order. */ - let newFileInfos = Array(claimsInfo.length), + let newFileInfos = Array(claimInfos.length), claimInfoProcessedCount = 0; - for (let [i, claimInfo] of claimsInfo.entries()) { + for (let [i, claimInfo] of claimInfos.entries()) { let metadata = JSON.parse(claimInfo.value); lbry.getFileInfoBySdHash(metadata.sources.lbry_sd_hash, (fileInfo) => { claimInfoProcessedCount++; if (fileInfo !== false) { newFileInfos[i] = fileInfo; } - if (claimInfoProcessedCount >= claimsInfo.length) { + if (claimInfoProcessedCount >= claimInfos.length) { /** * newfileInfos may have gaps from claims that don't have associated files in * lbrynet, so filter out any missing elements