Skip to content

Commit

Permalink
Fikser feil som endrer url til hovedside
Browse files Browse the repository at this point in the history
  • Loading branch information
ebelegu committed Nov 16, 2023
1 parent a11cb1a commit 7d3d93d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Pages/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Banner: FunctionComponent<OwnProps> = ({ sidetittel }) => {
if (orgnr !== null && organisasjoner[orgnr] !== undefined) {
endreOrganisasjon(organisasjoner[orgnr].organisasjon);
search.delete('bedrift');
navigate({ pathname: '/', search: search.toString() }, { replace: true });
navigate({ pathname: pathname, search: search.toString() }, { replace: true });
}

const useOrgnrHook: () => [string | null, (orgnr: string) => void] = useCallback(() => {
Expand Down Expand Up @@ -87,18 +87,13 @@ interface BrodsmuleProps {

export const Brodsmulesti = ({ brodsmuler }: BrodsmuleProps) => {
const navigate = useNavigate();
const { valgtOrganisasjon } = useContext(OrganisasjonsDetaljerContext);

const orgnrdel = valgtOrganisasjon
? `?bedrift=${valgtOrganisasjon.organisasjon.OrganizationNumber}`
: '';

onBreadcrumbClick((breadcrumb) => {
navigate(breadcrumb.url);
});

const defaultBrodsmule: Brodsmule[] = [
{ url: '/' + orgnrdel, title: 'Min side – arbeidsgiver', handleInApp: true },
{ url: '/', title: 'Min side – arbeidsgiver', handleInApp: true },
];

const breadcrumbs = defaultBrodsmule.concat(brodsmuler);
Expand Down

0 comments on commit 7d3d93d

Please sign in to comment.