Skip to content

Commit

Permalink
TEN-538: Abort call to Oversikt in SEDEdit when going to page directl…
Browse files Browse the repository at this point in the history
…y and navigating away
  • Loading branch information
rittikdey committed Dec 20, 2023
1 parent 858ada0 commit d02e12c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/SvarSed/SEDEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,18 @@ const SEDEdit = (): JSX.Element => {
}, [])

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

if (_.isUndefined(currentSak) && _.isUndefined(replySed)) {
if (sakId) {
dispatch(querySaks(sakId, 'refresh'))
dispatch(querySaks(sakId, 'refresh', false, signal))
}
}

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

0 comments on commit d02e12c

Please sign in to comment.