CASH-107: fix to close modal before page is left

This commit is contained in:
Adam Caouette 2025-01-16 11:44:32 -05:00
parent 63e11db537
commit 2eccc3b028
2 changed files with 7 additions and 3 deletions

View file

@ -50,6 +50,10 @@ export default {
mounted() { mounted() {
if (this.showSaveProgressPopup) this.modal.openModal(); if (this.showSaveProgressPopup) this.modal.openModal();
}, },
unmounted() {
// remove any modal effects before leaving page (e.g. user hits browser back button)
this.modal.closeModal();
},
emits: ["close-save-progress-popup", "save-progress"], // <--- should remove oodles of warnings in dev tools emits: ["close-save-progress-popup", "save-progress"], // <--- should remove oodles of warnings in dev tools
props: { props: {
modelValue: Object, modelValue: Object,

View file

@ -442,6 +442,9 @@ export default {
showSaveProgressPopup: null, showSaveProgressPopup: null,
}; };
}, },
mounted() {
this.attachCustomEvents();
},
computed: { computed: {
lineItemsCloneForWatcher() { lineItemsCloneForWatcher() {
return Object.assign({}, this.lineItems); return Object.assign({}, this.lineItems);
@ -677,9 +680,6 @@ export default {
}); });
}, },
}, },
mounted() {
this.attachCustomEvents();
},
watch: { watch: {
lineItemsCloneForWatcher: { lineItemsCloneForWatcher: {
handler(newValue, oldValue) { handler(newValue, oldValue) {