Skip to content

Commit

Permalink
TEN-538: Abort call to Oversikt in JournalFoering when going to page …
Browse files Browse the repository at this point in the history
…directly and navigating away
  • Loading branch information
rittikdey committed Dec 20, 2023
1 parent d02e12c commit edb7d0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/Journalfoering/Journalfoering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ export const Journalfoering: React.FC<JournalfoeringProps> = ({}: Journalfoering
}

useEffect(() => {
let controller = new AbortController();
const signal = controller.signal;

// reload, so it reflects changes made in potential SED save/send
if (!currentSak && sakId) {
dispatch(querySaks(sakId, 'refresh'))
dispatch(querySaks(sakId, 'refresh', false, signal))
}

return () => {
if(controller){
controller.abort();
}
}
}, [])

Expand Down

0 comments on commit edb7d0a

Please sign in to comment.