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

View file

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

View file

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