From 6651663a00f4c45de23bbf041fa82527ab81912b Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 22 Apr 2022 17:51:54 +0800 Subject: [PATCH] Discover: fix release_time for Tag and Wild West - I got the previous logic completely wrong. - Wild West's release time now comes from the homepage definition, but since the definition currently does not support "start of week", continue to hardcode the customization here. - This logic also fixes the release_time for Tags. --- ui/page/discover/view.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/page/discover/view.jsx b/ui/page/discover/view.jsx index e37ba35e8..1509da6da 100644 --- a/ui/page/discover/view.jsx +++ b/ui/page/discover/view.jsx @@ -176,10 +176,13 @@ function DiscoverPage(props: Props) { ); } - let releaseTime = - dynamicRouteProps && dynamicRouteProps.options && dynamicRouteProps.options.releaseTime - ? dynamicRouteProps.options.releaseTime - : !isWildWest && `>${Math.floor(moment().subtract(0, 'hour').startOf('week').unix())}`; + + let releaseTime = dynamicRouteProps?.options?.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())}`; + } return (