Merge pull request #243 from lbryio/desktop-fixes
fix: download list in correct order
This commit is contained in:
commit
fcc9746ff7
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;
|
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);
|
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);
|
||||||
|
@ -3246,7 +3246,7 @@ function doFileList(page = 1, pageSize = 99999) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: FILE_LIST_SUCCEEDED,
|
type: FILE_LIST_SUCCEEDED,
|
||||||
data: {
|
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) => {
|
return (dispatch, getState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const isFetching = selectIsFetchingFileList(state);
|
const isFetching = selectIsFetchingFileList(state);
|
||||||
|
@ -50,7 +50,7 @@ export function doFileList(page: number = 1, pageSize: number = 99999) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.FILE_LIST_SUCCEEDED,
|
type: ACTIONS.FILE_LIST_SUCCEEDED,
|
||||||
data: {
|
data: {
|
||||||
fileInfos: fileInfos.reverse(),
|
fileInfos: fileInfos,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -80,15 +80,17 @@ export const selectFileInfosDownloaded = createSelector(
|
||||||
selectFileInfosByOutpoint,
|
selectFileInfosByOutpoint,
|
||||||
selectMyClaims,
|
selectMyClaims,
|
||||||
(byOutpoint, myClaims) =>
|
(byOutpoint, myClaims) =>
|
||||||
Object.values(byOutpoint).filter(fileInfo => {
|
Object.values(byOutpoint)
|
||||||
const myClaimIds = myClaims.map(claim => claim.claim_id);
|
.reverse()
|
||||||
|
.filter(fileInfo => {
|
||||||
|
const myClaimIds = myClaims.map(claim => claim.claim_id);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
fileInfo &&
|
fileInfo &&
|
||||||
myClaimIds.indexOf(fileInfo.claim_id) === -1 &&
|
myClaimIds.indexOf(fileInfo.claim_id) === -1 &&
|
||||||
(fileInfo.completed || fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)
|
(fileInfo.completed || fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// export const selectFileInfoForUri = (state, props) => {
|
// export const selectFileInfoForUri = (state, props) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue