Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fjern unødvendig if-else sjekk #917

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading