Skip to content

Commit

Permalink
Vis "sendt sms" når man sender første melding (#592)
Browse files Browse the repository at this point in the history
* debug test melding

* marker i url at nydialog er nydialog 🐛

* prettier

---------

Co-authored-by: erikb <[email protected]>
  • Loading branch information
henriktheboss and moroministeren authored Dec 4, 2024
1 parent fca80b8 commit aadd80a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/view/dialog/DialogTrad.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Loader } from '@navikt/ds-react';
import classNames from 'classnames';
import React, { ReactNode, Suspense, useEffect, useMemo, useRef, useState } from 'react';
import React, { ReactNode, Suspense, useEffect, useMemo, useState } from 'react';
import { Await, useLocation } from 'react-router';
import { Navigate } from 'react-router-dom';
import { Navigate, useSearchParams } from 'react-router-dom';
import { useRoutes } from '../../routing/routes';
import { dispatchUpdate, UpdateTypes } from '../../utils/UpdateEvent';
import { useVisAktivitet } from '../AktivitetToggleContext';
Expand All @@ -19,8 +19,8 @@ import { DialogData } from '../../utils/Typer';
import { MaybeAktivitet } from '../AktivitetProvider';

export const DialogTrad = () => {
const [searchParams] = useSearchParams();
const { lesDialog } = useDialogContext();

const valgtDialog = useSelectedDialog();
const dialogId = valgtDialog?.id;
const fnr = useFnrContext();
Expand All @@ -36,7 +36,9 @@ export const DialogTrad = () => {
useEffect(() => {
// Hvis det navigeres til denne siden med en state (som arg i navigate) så puttes den i context
// Hvis ikke skal sistHandlingsType være INGEN (Ikke vis send bekreftelse)
if (!navigationState?.sistHandlingsType) {
if (searchParams.has('nyDialog')) {
setViewState({ sistHandlingsType: HandlingsType.nyDialog });
} else if (!navigationState?.sistHandlingsType) {
setViewState({ sistHandlingsType: HandlingsType.ingen });
} else if (navigationState.sistHandlingsType !== viewState.sistHandlingsType) {
setViewState({ sistHandlingsType: navigationState.sistHandlingsType });
Expand Down
2 changes: 1 addition & 1 deletion src/view/dialog/NyDialogForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export const nyDialogAction: (fnr: string | undefined) => ActionFunction =
slettKladd(null, dialog.aktivitetId);
dispatchUpdate(UpdateTypes.Dialog);
silentlyHentDialoger(fnr);
return redirect(`/${dialog.id}`);
return redirect(`/${dialog.id}?nyDialog`);
} else {
return null;
}
Expand Down

0 comments on commit aadd80a

Please sign in to comment.