diff --git a/src/moduler/mal/MalForm.tsx b/src/moduler/mal/MalForm.tsx index 6cd022793..d487d3752 100644 --- a/src/moduler/mal/MalForm.tsx +++ b/src/moduler/mal/MalForm.tsx @@ -3,7 +3,7 @@ import { Button, Textarea } from '@navikt/ds-react'; import { isFulfilled } from '@reduxjs/toolkit'; import React, { MutableRefObject, useLayoutEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; -import { useSelector } from 'react-redux'; +import { shallowEqual, useSelector } from 'react-redux'; import { z } from 'zod'; import useAppDispatch from '../../felles-komponenter/hooks/useAppDispatch'; @@ -12,6 +12,7 @@ import Feilmelding from '../feilmelding/Feilmelding'; import { oppdaterMal } from './aktivitetsmal-slice'; import { hentMalListe } from './malliste-slice'; import { logKlikkKnapp } from '../../amplitude/amplitude'; +import { selectErUnderOppfolging, selectHarSkriveTilgang } from '../oppfolging-status/oppfolging-selector'; const schema = z.object({ mal: z.string().min(1, 'Feltet må fylles ut').max(500, 'Du må korte ned teksten til 500 tegn'), @@ -61,7 +62,7 @@ const MalForm = (props: Props) => { register, handleSubmit, watch, - formState: { errors, isDirty }, + formState: { errors, isDirty, isSubmitting }, } = useForm({ defaultValues, resolver: zodResolver(schema), shouldFocusError: true }); if (dirtyRef) { @@ -71,6 +72,8 @@ const MalForm = (props: Props) => { const malValue = watch('mal'); // for