Skip to content

Commit

Permalink
Merge pull request #681 from dotkom/feat/removeSplash
Browse files Browse the repository at this point in the history
commented out splash redirect
  • Loading branch information
madsab authored Aug 29, 2023
2 parents 1ce37ba + 308a51a commit e783fc4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/core/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head';
import React, { FC, useEffect } from 'react';
import React, { FC } from 'react';

import Footer from './components/Footer/index';
import Header from './components/Header/index';
Expand All @@ -9,15 +9,15 @@ import { AuthenticationProvider } from 'authentication/providers/AuthenticationP
import { SilentRenew } from 'authentication/components/SilentRenew';

const Core: FC = ({ children }) => {
useEffect(() => {
const splash = sessionStorage.getItem('splash');
const isLandingPage = window.location.pathname === '/';
const shouldRedirect = !splash || new Date().getTime() - new Date(splash).getTime() > 1000 * 60 * 10;
if (shouldRedirect && isLandingPage) {
sessionStorage.setItem('splash', `${new Date()}`);
window.location.assign('https://splash.online.ntnu.no');
}
}, []);
// useEffect(() => {
// const splash = sessionStorage.getItem('splash');
// const isLandingPage = window.location.pathname === '/';
// const shouldRedirect = !splash || new Date().getTime() - new Date(splash).getTime() > 1000 * 60 * 10;
// if (shouldRedirect && isLandingPage) {
// sessionStorage.setItem('splash', `${new Date()}`);
// window.location.assign('https://splash.online.ntnu.no');
// }
// }, []);

return (
<>
Expand Down

1 comment on commit e783fc4

@vercel
Copy link

@vercel vercel bot commented on e783fc4 Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.