fix(timer): add timer for unavailable text

keep-around/44e70269ba4e4c3ea8c912424bbb3a0e479f07f4
Andrei Dekterev 3 years ago committed by Gitea
parent b556416aae
commit 12c01cbc63
  1. 9
      src/features/App/index.tsx
  2. 2
      src/features/UserFavorites/hooks/index.tsx

@ -44,6 +44,10 @@ const Main = () => {
return <AuthenticatedApp />
}
const date = new Date()
const startDate = '2022-11-24T23:00:00'
const stopDate = '2022-11-25T05:00:00'
const OTTApp = () => (
<MatomoProvider value={matomoInstance}>
<Router history={history}>
@ -52,7 +56,10 @@ const OTTApp = () => (
<GlobalStores>
<Background>
<Suspense fallback={null}>
{isAvailable ? (<Main />) : (<UnavailableText />)}
{isAvailable
&& (date.getTime() < new Date(startDate).getTime()
|| date.getTime() > new Date(stopDate).getTime())
? (<Main />) : (<UnavailableText />)}
</Suspense>
</Background>
</GlobalStores>

@ -56,7 +56,7 @@ export const useUserFavorites = () => {
userFavorites,
(acc, item) => {
if (
item.info.super_tournament
item?.info?.super_tournament
&& !uniqueTournamnetIds[item.info.super_tournament.id]
) {
uniqueTournamnetIds[item.info.super_tournament.id] = item.info.super_tournament.id

Loading…
Cancel
Save