From 909a82d9a147f44b257c72eceefb270dbc7521ba Mon Sep 17 00:00:00 2001 From: Hallvard Andreas Stark <57254397+hallvardastark@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:51:25 +0200 Subject: [PATCH] Forhindrer evig spinner (#5101) --- .../src/components/FritekstRedigering/FritekstRedigering.tsx | 4 +++- packages/prosess-vedtak/src/components/brev/BrevPanel.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/prosess-vedtak/src/components/FritekstRedigering/FritekstRedigering.tsx b/packages/prosess-vedtak/src/components/FritekstRedigering/FritekstRedigering.tsx index 72a5734e9a..5fdf8c9e61 100644 --- a/packages/prosess-vedtak/src/components/FritekstRedigering/FritekstRedigering.tsx +++ b/packages/prosess-vedtak/src/components/FritekstRedigering/FritekstRedigering.tsx @@ -61,7 +61,9 @@ const FritekstRedigering = ({ overstyrtMottaker, setForhaandsvisningKlart, }: ownProps & WrappedComponentProps) => { - useEffect(() => {}, []); + useEffect(() => { + setForhaandsvisningKlart(false); + }, []); const redigerbarDokumentmal: VedtaksbrevMal = tilgjengeligeVedtaksbrev.maler.find( vb => vb.dokumentMalType === dokumentMalType.MANUELL, ); diff --git a/packages/prosess-vedtak/src/components/brev/BrevPanel.tsx b/packages/prosess-vedtak/src/components/brev/BrevPanel.tsx index 64871d04cf..c3915d58b1 100644 --- a/packages/prosess-vedtak/src/components/brev/BrevPanel.tsx +++ b/packages/prosess-vedtak/src/components/brev/BrevPanel.tsx @@ -188,7 +188,7 @@ export const BrevPanel: React.FC = props => { lagreDokumentdata, getPreviewAutomatiskBrevCallback, } = props; - const [forhaandsvisningKlart, setForhaandsvisningKlart] = useState(false); + const [forhaandsvisningKlart, setForhaandsvisningKlart] = useState(true); const [, meta] = useField({ name: 'overstyrtMottaker' }); const automatiskBrevCallback = getPreviewAutomatiskBrevCallback(formikProps.values)({ aapneINyttVindu: true });