We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8d127f commit f6a0b6bCopy full SHA for f6a0b6b
adminforth/spa/src/views/CreateView.vue
@@ -121,7 +121,7 @@ async function onUpdateRecord(newRecord: any) {
121
}
122
123
function checkIfWeCanLeavePage() {
124
- return cancelButtonClicked.value || JSON.stringify(record.value) === JSON.stringify(initialValues.value);
+ return wasSaveSuccessful.value || cancelButtonClicked.value || JSON.stringify(record.value) === JSON.stringify(initialValues.value);
125
126
127
window.addEventListener('beforeunload', (event) => {
@@ -227,6 +227,7 @@ async function saveRecord() {
227
showErrorTost(response.error);
228
} else {
229
saving.value = false;
230
+ wasSaveSuccessful.value = true;
231
if (route.query.returnTo) {
232
router.push(<string>route.query.returnTo);
233
0 commit comments