fix sort for pending publishes

This commit is contained in:
Sean Yesmunt 2019-07-09 01:58:31 -04:00
parent 310e0f5bd6
commit 0ff6364a40
2 changed files with 18 additions and 2 deletions

10
dist/bundle.es.js vendored
View file

@ -1380,7 +1380,15 @@ const selectMyClaims = reselect.createSelector(selectMyActiveClaims, selectClaim
const selectMyClaimsWithoutChannels = reselect.createSelector(selectMyClaims, myClaims => myClaims.filter(claim => !claim.name.match(/^@/)).sort((a, b) => a.timestamp - b.timestamp));
const selectMyClaimUrisWithoutChannels = reselect.createSelector(selectMyClaimsWithoutChannels, myClaims => myClaims.sort((a, b) => b.timestamp - a.timestamp).map(claim => `lbry://${claim.name}#${claim.claim_id}`));
const selectMyClaimUrisWithoutChannels = reselect.createSelector(selectMyClaimsWithoutChannels, myClaims => myClaims.sort((a, b) => {
if (!a.timestamp) {
return -1;
} else if (!b.timestamp) {
return 1;
} else {
return b.timestamp - a.timestamp;
}
}).map(claim => `lbry://${claim.name}#${claim.claim_id}`));
const selectAllMyClaimsByOutpoint = reselect.createSelector(selectMyClaimsRaw, claims => new Set(claims && claims.length ? claims.map(claim => `${claim.txid}:${claim.nout}`) : null));

View file

@ -274,7 +274,15 @@ export const selectMyClaimUrisWithoutChannels = createSelector(
selectMyClaimsWithoutChannels,
myClaims =>
myClaims
.sort((a, b) => b.timestamp - a.timestamp)
.sort((a, b) => {
if (!a.timestamp) {
return -1;
} else if (!b.timestamp) {
return 1;
} else {
return b.timestamp - a.timestamp;
}
})
.map(claim => `lbry://${claim.name}#${claim.claim_id}`)
);