From 04c4988a9afcf57355db2d65d72e962edd1471a5 Mon Sep 17 00:00:00 2001 From: 6ea86b96 <6ea86b96@gmail.com> Date: Thu, 15 Jun 2017 11:26:26 +0700 Subject: [PATCH] Always refresh claims/file info on downloaded/published pages --- ui/js/actions/file_info.js | 9 ++------- ui/js/component/fileList/view.jsx | 2 +- ui/js/page/fileListDownloaded/view.jsx | 2 +- ui/js/page/fileListPublished/view.jsx | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ui/js/actions/file_info.js b/ui/js/actions/file_info.js index d379db625..a8d275b35 100644 --- a/ui/js/actions/file_info.js +++ b/ui/js/actions/file_info.js @@ -102,12 +102,7 @@ export function doFetchFileInfosAndPublishedClaims() { isClaimListMinePending = selectClaimListMineIsPending(state), isFileInfoListPending = selectFileListIsPending(state); - 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/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() {