Use hasEdits computed inside navigation guard

This commit is contained in:
Nicola Krumschmidt
2020-10-22 18:20:54 +02:00
parent c5742b6557
commit f17dbd4e25

View File

@@ -324,9 +324,7 @@ export default defineComponent({
useShortcut('meta+shift+s', saveAndAddNew, form);
const navigationGuard: NavigationGuard = (to, from, next) => {
const hasEdits = Object.keys(edits.value).length > 0;
if (hasEdits) {
if (hasEdits.value) {
confirmLeave.value = true;
leaveTo.value = to.fullPath;
return next(false);