Skip to content

Commit

Permalink
node def editor: fixed unsaved changes confirm dialog appears on save…
Browse files Browse the repository at this point in the history
…&back (#3480)

* node def editor: fixed confirm dialog appears on save&back

* hide loader after timeout

---------

Co-authored-by: Stefano Ricci <SteRiccio@users.noreply.github.com>
  • Loading branch information
SteRiccio and SteRiccio committed Jun 13, 2024
1 parent 1b78bd8 commit 9dd7b1f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ export const useSaveEdits = ({ setState }) => {
})
)

dispatch(LoaderActions.hideLoader())

dispatch(NotificationActions.notifyInfo({ key: 'common.saved', timeout: 3000 }))

if (goBackOnEnd) {
navigate(-1)
// workaround: navigate one page back only when local state is updated
setTimeout(() => {
dispatch(LoaderActions.hideLoader())
navigate(-1)
}, 500)
} else {
dispatch(LoaderActions.hideLoader())
}
}, [])
}

0 comments on commit 9dd7b1f

Please sign in to comment.