fix: download list in correct order
This commit is contained in:
parent
4491b975cc
commit
32875c3ba7
3 changed files with 14 additions and 12 deletions
4
dist/bundle.es.js
vendored
4
dist/bundle.es.js
vendored
|
@ -2970,7 +2970,7 @@ const makeSelectLoadingForUri = uri => reselect.createSelector(selectUrisLoading
|
|||
return isFetching;
|
||||
});
|
||||
|
||||
const selectFileInfosDownloaded = reselect.createSelector(selectFileInfosByOutpoint, selectMyClaims, (byOutpoint, myClaims) => Object.values(byOutpoint).filter(fileInfo => {
|
||||
const selectFileInfosDownloaded = reselect.createSelector(selectFileInfosByOutpoint, selectMyClaims, (byOutpoint, myClaims) => Object.values(byOutpoint).reverse().filter(fileInfo => {
|
||||
const myClaimIds = myClaims.map(claim => claim.claim_id);
|
||||
|
||||
return fileInfo && myClaimIds.indexOf(fileInfo.claim_id) === -1 && (fileInfo.completed || fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0);
|
||||
|
@ -3246,7 +3246,7 @@ function doFileList(page = 1, pageSize = 99999) {
|
|||
dispatch({
|
||||
type: FILE_LIST_SUCCEEDED,
|
||||
data: {
|
||||
fileInfos: fileInfos.reverse()
|
||||
fileInfos: fileInfos
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ export function doFetchFileInfo(uri) {
|
|||
};
|
||||
}
|
||||
|
||||
export function doFileList(page: number = 1, pageSize: number = 99999) {
|
||||
export function doFileList(page = 1, pageSize = 99999) {
|
||||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
const isFetching = selectIsFetchingFileList(state);
|
||||
|
@ -50,7 +50,7 @@ export function doFileList(page: number = 1, pageSize: number = 99999) {
|
|||
dispatch({
|
||||
type: ACTIONS.FILE_LIST_SUCCEEDED,
|
||||
data: {
|
||||
fileInfos: fileInfos.reverse(),
|
||||
fileInfos: fileInfos,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
@ -80,15 +80,17 @@ export const selectFileInfosDownloaded = createSelector(
|
|||
selectFileInfosByOutpoint,
|
||||
selectMyClaims,
|
||||
(byOutpoint, myClaims) =>
|
||||
Object.values(byOutpoint).filter(fileInfo => {
|
||||
const myClaimIds = myClaims.map(claim => claim.claim_id);
|
||||
Object.values(byOutpoint)
|
||||
.reverse()
|
||||
.filter(fileInfo => {
|
||||
const myClaimIds = myClaims.map(claim => claim.claim_id);
|
||||
|
||||
return (
|
||||
fileInfo &&
|
||||
myClaimIds.indexOf(fileInfo.claim_id) === -1 &&
|
||||
(fileInfo.completed || fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)
|
||||
);
|
||||
})
|
||||
return (
|
||||
fileInfo &&
|
||||
myClaimIds.indexOf(fileInfo.claim_id) === -1 &&
|
||||
(fileInfo.completed || fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
// export const selectFileInfoForUri = (state, props) => {
|
||||
|
|
Loading…
Reference in a new issue