Skip to content

Commit

Permalink
Revert "Fix uploads page cleared/reloaded on each navigation" (#1771)
Browse files Browse the repository at this point in the history
This reverts commit 1dccc1a.

Closes 1770
Re-opens "1515 uploads page cleared/reloaded on each navigation"

1515 is just a minor annoyance, while the current issue is a non-functional page, so reverting for now and revisit later.
  • Loading branch information
infinite-persistence authored Jun 29, 2022
1 parent 3f44b80 commit 4b1bf22
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions ui/page/fileListPublished/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const FILTER_ALL = 'stream,repost';
const FILTER_UPLOADS = 'stream';
const FILTER_REPOSTS = 'repost';

let session;

type Props = {
uploadCount: number,
claimsByUri: { [string]: any },
Expand All @@ -29,7 +27,7 @@ type Props = {
fetching: boolean,
urls: Array<string>,
urlTotal: number,
history: { action: string, replace: (string) => void, push: (string) => void },
history: { replace: (string) => void, push: (string) => void },
page: number,
pageSize: number,
doFetchViewCount: (claimIdCsv: string) => void,
Expand All @@ -45,16 +43,11 @@ function FileListPublished(props: Props) {
fetching,
urls,
urlTotal,
history,
page,
pageSize,
doFetchViewCount,
} = props;

const { action: historyAction } = history;
const refreshedPage = session === undefined;
const navigated = historyAction === 'POP' && !refreshedPage;

const [filterBy, setFilterBy] = React.useState(FILTER_ALL);
const params = {};

Expand All @@ -63,20 +56,16 @@ function FileListPublished(props: Props) {

const paramsString = JSON.stringify(params);

React.useEffect(() => {
session = Date.now();
}, []);

useEffect(() => {
checkPendingPublishes();
}, [checkPendingPublishes]);

useEffect(() => {
if (paramsString && fetchClaimListMine && !navigated) {
if (paramsString && fetchClaimListMine) {
const params = JSON.parse(paramsString);
fetchClaimListMine(params.page, params.page_size, true, filterBy.split(','));
}
}, [uploadCount, paramsString, filterBy, fetchClaimListMine, navigated]);
}, [uploadCount, paramsString, filterBy, fetchClaimListMine]);

useFetchViewCount(!fetching, urls, claimsByUri, doFetchViewCount);

Expand Down

0 comments on commit 4b1bf22

Please sign in to comment.