diff --git a/ui/js/actions/file_info.js b/ui/js/actions/file_info.js index f200c40fc..3ee12aa02 100644 --- a/ui/js/actions/file_info.js +++ b/ui/js/actions/file_info.js @@ -98,16 +98,9 @@ export function doDeleteFile(outpoint, deleteFromComputer) { export function doFetchFileInfosAndPublishedClaims() { return function(dispatch, getState) { - const state = getState(), - isClaimListMinePending = selectClaimListMineIsPending(state), - isFileInfoListPending = selectFileListIsPending(state); + const state = getState(); - if (isClaimListMinePending === undefined) { - dispatch(doFetchClaimListMine()); - } - - if (isFileInfoListPending === undefined) { - dispatch(doFileList()); - } + dispatch(doFetchClaimListMine()); + dispatch(doFileList()); }; } diff --git a/ui/js/component/fileList/view.jsx b/ui/js/component/fileList/view.jsx index 664ae97d3..4e35ec948 100644 --- a/ui/js/component/fileList/view.jsx +++ b/ui/js/component/fileList/view.jsx @@ -82,7 +82,7 @@ class FileList extends React.PureComponent { }); return (
- {fetching && } + {fetching && } {__("Sort by")} {" "} diff --git a/ui/js/component/fileTile/view.jsx b/ui/js/component/fileTile/view.jsx index 27511defd..d19ce0137 100644 --- a/ui/js/component/fileTile/view.jsx +++ b/ui/js/component/fileTile/view.jsx @@ -19,14 +19,14 @@ class FileTile extends React.PureComponent { } componentDidMount() { - this.resolve(this.props); + const { isResolvingUri, claim, uri, resolveUri } = this.props; + + if (!isResolvingUri && !claim && uri) resolveUri(uri); } componentWillReceiveProps(nextProps) { - this.resolve(nextProps); - } + const { isResolvingUri, claim, uri, resolveUri } = this.props; - resolve({ isResolvingUri, claim, uri, resolveUri }) { if (!isResolvingUri && claim === undefined && uri) resolveUri(uri); } diff --git a/ui/js/lbry.js b/ui/js/lbry.js index a2c7affde..3f4feecb7 100644 --- a/ui/js/lbry.js +++ b/ui/js/lbry.js @@ -417,7 +417,7 @@ lbry.file_list = function(params = {}) { return; } } - + apiCall( "file_list", params, @@ -458,30 +458,21 @@ lbry.claim_list_mine = function(params = {}) { }); }; -const claimCacheKey = "resolve_claim_cache"; -lbry._claimCache = getSession(claimCacheKey, {}); + lbry._resolveXhrs = {}; lbry.resolve = function(params = {}) { return new Promise((resolve, reject) => { if (!params.uri) { throw __("Resolve has hacked cache on top of it that requires a URI"); } - if (params.uri && lbry._claimCache[params.uri] !== undefined) { - resolve(lbry._claimCache[params.uri]); - } else { - lbry._resolveXhrs[params.uri] = apiCall( - "resolve", - params, - data => { - if (data !== undefined) { - lbry._claimCache[params.uri] = data; - } - setSession(claimCacheKey, lbry._claimCache); - resolve(data && data[params.uri] ? data[params.uri] : {}); - }, - reject - ); - } + lbry._resolveXhrs[params.uri] = apiCall( + "resolve", + params, + function(data) { + resolve(data && data[params.uri] ? data[params.uri] : {}); + }, + reject + ); }); }; diff --git a/ui/js/page/fileListDownloaded/view.jsx b/ui/js/page/fileListDownloaded/view.jsx index 518a5c2f2..77f1091db 100644 --- a/ui/js/page/fileListDownloaded/view.jsx +++ b/ui/js/page/fileListDownloaded/view.jsx @@ -12,7 +12,7 @@ import SubHeader from "component/subHeader"; class FileListDownloaded extends React.PureComponent { componentWillMount() { - this.props.fetchFileInfosDownloaded(); + if (!this.props.isPending) this.props.fetchFileInfosDownloaded(); } render() { diff --git a/ui/js/page/fileListPublished/view.jsx b/ui/js/page/fileListPublished/view.jsx index 90c7aad47..3af905a51 100644 --- a/ui/js/page/fileListPublished/view.jsx +++ b/ui/js/page/fileListPublished/view.jsx @@ -12,7 +12,7 @@ import SubHeader from "component/subHeader"; class FileListPublished extends React.PureComponent { componentWillMount() { - this.props.fetchFileListPublished(); + if (!this.props.isPending) this.props.fetchFileListPublished(); } componentDidUpdate() {