Skip to content

Commit

Permalink
Merge pull request #917 from navikt/dependabot
Browse files Browse the repository at this point in the history
Fjern unødvendig if-else sjekk
  • Loading branch information
slovrid authored Feb 23, 2024
2 parents 0127d09 + b69b1f7 commit 20a73e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/hooks/use-redirect-on-mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20a73e1

Please sign in to comment.