Skip to content

Commit

Permalink
Update unsaved-data-changes-alert.blade.php
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Apr 18, 2024
1 parent 4d71b03 commit 98c4703
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@
<script>
let formSubmitted = false
document.addEventListener('submit', () => formSubmitted = true)
document.addEventListener(
'submit',
() => (formSubmitted = true),
)
shouldPreventNavigation = () => {
if (formSubmitted) {
return
}
return window.jsMd5(
JSON.stringify($wire.data).replace(/\\/g, ''),
) !== $wire.savedDataHash ||
$wire?.__instance?.effects?.redirect
return (
window.jsMd5(
JSON.stringify($wire.data).replace(/\\/g, ''),
) !== $wire.savedDataHash ||
$wire?.__instance?.effects?.redirect
)
}
const showUnsavedChangesAlert = () => {
Expand Down

0 comments on commit 98c4703

Please sign in to comment.