Skip to content

Commit

Permalink
Bedre feilmelding på /les
Browse files Browse the repository at this point in the history
  • Loading branch information
tu55eladd committed Dec 20, 2024
1 parent 642e5f2 commit ce479df
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/view/dialog/DialogTrad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import HistoriskInfo from './HistoriskInfo';
import { useRootLoaderData } from '../../routing/loaders';
import { DialogData } from '../../utils/Typer';
import { MaybeAktivitet } from '../AktivitetProvider';
import { captureMessage } from '../../utils/errorCapture';

export const DialogTrad = () => {
const [searchParams] = useSearchParams();
Expand Down Expand Up @@ -64,10 +65,14 @@ export const DialogTrad = () => {
useEffect(() => {
if (!lest && activeTab && activePersonflateTab) {
if (!dialogId) return;
lesDialog(dialogId, fnr).then(() => {
dispatchUpdate(UpdateTypes.Dialog);
window.dispatchEvent(new Event('aktivitetsplan.dialog.lest')); //lest teller i personflata
});
lesDialog(dialogId, fnr)
.then(() => {
dispatchUpdate(UpdateTypes.Dialog);
window.dispatchEvent(new Event('aktivitetsplan.dialog.lest')); //lest teller i personflata
})
.catch((error) => {
captureMessage(`Klarte ikke markere dialog som lest ${error.toString()}`);
});
}
}, [dialogId, lest, activeTab, activePersonflateTab, fnr]);

Expand Down

0 comments on commit ce479df

Please sign in to comment.