Fix unsaved changes warning erronously appearing

This commit is contained in:
James Grugett 2022-09-18 16:36:45 -05:00
parent 373cfc5d10
commit ae6437442b

View File

@ -25,7 +25,7 @@ export const useWarnUnsavedChanges = (hasUnsavedChanges: boolean) => {
}
window.addEventListener('beforeunload', warnUnsavedChanges)
Router.events.on('routeChangeStart', (href) => beforeRouteHandler(href))
Router.events.on('routeChangeStart', beforeRouteHandler)
return () => {
window.removeEventListener('beforeunload', warnUnsavedChanges)