From b69b1f7c371f052db58300f8c15b6137d4036297 Mon Sep 17 00:00:00 2001 From: Sondre Larsen Ovrid Date: Thu, 22 Feb 2024 15:21:53 +0100 Subject: [PATCH] =?UTF-8?q?Fjern=20un=C3=B8dvendig=20if-else=20sjekk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/use-redirect-on-mount.ts | 4 ---- src/utils/utils.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/hooks/use-redirect-on-mount.ts b/src/hooks/use-redirect-on-mount.ts index 8dbea3da9..822c3a151 100644 --- a/src/hooks/use-redirect-on-mount.ts +++ b/src/hooks/use-redirect-on-mount.ts @@ -3,7 +3,6 @@ import {useOnMount} from './use-on-mount'; import * as queryString from 'query-string'; import {settSortering} from '../ducks/portefolje'; import {useDispatch} from 'react-redux'; -import {erGithubPages} from '../utils/utils'; export function useRedirectOnMount() { const history = useHistory(); @@ -21,9 +20,6 @@ export function useRedirectOnMount() { const stringified = queryString.stringify(parsed); dispatch(settSortering('ikke_satt', 'ikke_satt')); history.replace(`${pathname}?${stringified}`); - } else if (erGithubPages()) { - history.push('/enhet'); - return; } else if (lastPath && location.pathname === '/tilbake') { history.replace({pathname: lastPath, search: lastSearch}); const sorteringsfelt = queryString.parse(lastSearch).sorteringsfelt; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index ca0022c35..acecb7c2c 100755 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -55,10 +55,6 @@ export function utledValgteAktivitetsTyper( }, {}); } -export function erGithubPages() { - return window.location.host.includes('navikt.github.io'); -} - export function utlopsdatoUker(utlopsdatoStr?: string): number | undefined { if (!utlopsdatoStr) { return undefined;