Skip to content

Commit

Permalink
Merge pull request #18 from senkulabs/17-fix-modal-when-delete-account
Browse files Browse the repository at this point in the history
Fix Modal Issue After Delete User Account.
  • Loading branch information
kresnasatya authored Dec 16, 2024
2 parents 4e439c4 + 3694052 commit 4aee6c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
password: ''
});
function closeModal() {
$form.clearErrors();
$form.reset();
confirmingUserDeletion = false;
}
function confirmUserDeletion() {
confirmingUserDeletion = true;
setTimeout(() => passwordInput?.focus(), 250);
}
function deleteUser() {
$form.delete(route('profile.destroy'), {
preserveScroll: true,
onSuccess: () => closeModal(),
onError: () => passwordInput?.focus(),
onFinish: () => $form.reset()
});
confirmUserDeletion = false;
}
function closeModal() {
$form.clearErrors();
$form.reset();
confirmingUserDeletion = false;
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
function deleteUser() {
$form.delete(route('profile.destroy'), {
preserveScroll: true,
onSuccess: () => closeModal(),
onError: () => passwordInput?.focus(),
onFinish: () => $form.reset(),
});
};
confirmUserDeletion = false;
}
function closeModal() {
$form.clearErrors();
$form.reset();
confirmingUserDeletion = false;
};
}
</script>
<section class="space-y-6 {className}">
Expand Down

0 comments on commit 4aee6c1

Please sign in to comment.