Fix release time on category pages

This commit is contained in:
Thomas Zarebczan 2022-04-14 13:58:19 -04:00 committed by Thomas Zarebczan
parent 934f627c19
commit 7622e7aaf2
3 changed files with 8 additions and 7 deletions

View file

@ -8,7 +8,7 @@ declare type HomepageObject = {
declare type HomepageData = { declare type HomepageData = {
[string]: HomepageObject, [string]: HomepageObject,
default: any => any, default: (any) => any,
}; };
declare type RowDataItem = { declare type RowDataItem = {
@ -24,6 +24,7 @@ declare type RowDataItem = {
channelIds?: Array<string>, channelIds?: Array<string>,
limitClaimsPerChannel?: number, limitClaimsPerChannel?: number,
pageSize?: number, pageSize?: number,
releaseTime?: string,
}, },
route?: string, route?: string,
hideForUnauth?: boolean, hideForUnauth?: boolean,

View file

@ -177,6 +177,10 @@ function DiscoverPage(props: Props) {
</span> </span>
); );
} }
let releaseTime =
dynamicRouteProps && dynamicRouteProps.options && dynamicRouteProps.options.releaseTime
? dynamicRouteProps.options.releaseTime
: !dynamicRouteProps && !tags && `>${Math.floor(moment().subtract(0, 'hour').startOf('week').unix())}`;
return ( return (
<Page <Page
@ -202,11 +206,7 @@ function DiscoverPage(props: Props) {
// until we are sure this page will stay around // until we are sure this page will stay around
// TODO: find a better way to determine discover / wild west vs other modes release times // TODO: find a better way to determine discover / wild west vs other modes release times
// for now including && !tags so that // for now including && !tags so that
releaseTime={ releaseTime={releaseTime || undefined}
SIMPLE_SITE
? !dynamicRouteProps && !tags && `>${Math.floor(moment().subtract(1, 'day').startOf('week').unix())}`
: undefined
}
feeAmount={SIMPLE_SITE ? !dynamicRouteProps && CS.FEE_AMOUNT_ANY : undefined} feeAmount={SIMPLE_SITE ? !dynamicRouteProps && CS.FEE_AMOUNT_ANY : undefined}
channelIds={channelIds} channelIds={channelIds}
limitClaimsPerChannel={ limitClaimsPerChannel={

View file

@ -100,7 +100,7 @@ export const getHomepageRowForCat = (key: string, cat: HomepageCat) => {
releaseTime: `>${Math.floor( releaseTime: `>${Math.floor(
moment() moment()
.subtract(cat.daysOfContent || 30, 'days') .subtract(cat.daysOfContent || 30, 'days')
.startOf('week') .startOf('hour')
.unix() .unix()
)}`, )}`,
}, },