Fix 'freshness' filter not working in Category Pages
## Issue Ticket: 1484 The commit `7622e7a: Fix release time on category pages` passes in the `releaseTime` prop, which usually means we want that value to be override. ## Change Only pass the prop when there 'freshness' filter is not active.
This commit is contained in:
parent
123496e734
commit
c4f88ac7e8
1 changed files with 10 additions and 1 deletions
|
@ -63,6 +63,8 @@ function DiscoverPage(props: Props) {
|
|||
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
|
||||
const claimType = urlParams.get('claim_type');
|
||||
const tagsQuery = urlParams.get('t') || null;
|
||||
const freshnessParam = urlParams.get(CS.FRESH_KEY);
|
||||
const orderParam = urlParams.get(CS.ORDER_BY_KEY);
|
||||
const tags = tagsQuery ? tagsQuery.split(',') : null;
|
||||
const repostedClaimIsResolved = repostedUri && repostedClaim;
|
||||
const hideRepostRibbon = isCategory && !isWildWest;
|
||||
|
@ -185,11 +187,18 @@ function DiscoverPage(props: Props) {
|
|||
);
|
||||
}
|
||||
|
||||
let releaseTime = dynamicRouteProps?.options?.releaseTime;
|
||||
const categoryReleaseTime = dynamicRouteProps?.options?.releaseTime;
|
||||
let releaseTime;
|
||||
|
||||
if (isWildWest) {
|
||||
// The homepage definition currently does not support 'start-of-week', so
|
||||
// continue to hardcode here for now.
|
||||
releaseTime = `>${Math.floor(moment().subtract(0, 'hour').startOf('week').unix())}`;
|
||||
} else if (categoryReleaseTime) {
|
||||
const hasFreshnessOverride = orderParam === CS.ORDER_BY_TOP && freshnessParam !== null;
|
||||
if (!hasFreshnessOverride) {
|
||||
releaseTime = categoryReleaseTime;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue