mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-11 13:09:44 +00:00
remove homepage hack from ClaimListDiscover and fix order so release_time filter is set properly
This commit is contained in:
parent
cd3f30e03e
commit
851b2d13e4
1 changed files with 24 additions and 31 deletions
|
@ -191,6 +191,30 @@ function ClaimListDiscover(props: Props) {
|
||||||
: CS.ORDER_BY_TOP_VALUE, // Sort by top
|
: CS.ORDER_BY_TOP_VALUE, // Sort by top
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
||||||
|
options.fee_amount = feeAmountParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (claimIds) {
|
||||||
|
options.claim_ids = claimIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channelIdsParam) {
|
||||||
|
options.channel_ids = channelIdsParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tagsParam) {
|
||||||
|
if (tagsParam !== CS.TAGS_ALL && tagsParam !== '') {
|
||||||
|
if (tagsParam === CS.TAGS_FOLLOWED) {
|
||||||
|
options.any_tags = followed;
|
||||||
|
} else if (Array.isArray(tagsParam)) {
|
||||||
|
options.any_tags = tagsParam;
|
||||||
|
} else {
|
||||||
|
options.any_tags = tagsParam.split(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (repostedClaimId) {
|
if (repostedClaimId) {
|
||||||
// SDK chokes on reposted_claim_id of null or false, needs to not be present if no value
|
// SDK chokes on reposted_claim_id of null or false, needs to not be present if no value
|
||||||
options.reposted_claim_id = repostedClaimId;
|
options.reposted_claim_id = repostedClaimId;
|
||||||
|
@ -230,29 +254,10 @@ function ClaimListDiscover(props: Props) {
|
||||||
.startOf('week')
|
.startOf('week')
|
||||||
.unix()
|
.unix()
|
||||||
)}`;
|
)}`;
|
||||||
} else {
|
|
||||||
// Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
|
|
||||||
options.release_time = `<${Math.floor(
|
|
||||||
moment()
|
|
||||||
.startOf('minute')
|
|
||||||
.unix()
|
|
||||||
)}`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
|
||||||
options.fee_amount = feeAmountParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (claimIds) {
|
|
||||||
options.claim_ids = claimIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (channelIdsParam) {
|
|
||||||
options.channel_ids = channelIdsParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (durationParam) {
|
if (durationParam) {
|
||||||
if (durationParam === CS.DURATION_SHORT) {
|
if (durationParam === CS.DURATION_SHORT) {
|
||||||
options.duration = '<=1800';
|
options.duration = '<=1800';
|
||||||
|
@ -275,18 +280,6 @@ function ClaimListDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tagsParam) {
|
|
||||||
if (tagsParam !== CS.TAGS_ALL && tagsParam !== '') {
|
|
||||||
if (tagsParam === CS.TAGS_FOLLOWED) {
|
|
||||||
options.any_tags = followed;
|
|
||||||
} else if (Array.isArray(tagsParam)) {
|
|
||||||
options.any_tags = tagsParam;
|
|
||||||
} else {
|
|
||||||
options.any_tags = tagsParam.split(',');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hideReposts && !options.reposted_claim_id && !forceShowReposts) {
|
if (hideReposts && !options.reposted_claim_id && !forceShowReposts) {
|
||||||
if (Array.isArray(options.claim_type)) {
|
if (Array.isArray(options.claim_type)) {
|
||||||
if (options.claim_type.length > 1) {
|
if (options.claim_type.length > 1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue