Fix release time on category pages
This commit is contained in:
parent
934f627c19
commit
7622e7aaf2
3 changed files with 8 additions and 7 deletions
3
flow-typed/homepage.js
vendored
3
flow-typed/homepage.js
vendored
|
@ -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,
|
||||
|
|
|
@ -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={
|
||||
|
|
|
@ -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()
|
||||
)}`,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue