Skip to content

Commit

Permalink
Merge pull request #981 from mattburnett-repo/980
Browse files Browse the repository at this point in the history
Bug: 980 (Cannot read properties of undefined (reading 'isOpen') in MediaImageCarousel.vue)
  • Loading branch information
andrewtavis authored Oct 2, 2024
2 parents a7cfdf3 + e377b89 commit 07f589b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/components/modal/ModalBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ const closeModal = () => {
modals.closeModal(modalName);
};
// If the user changes the route while the modal is open, close the modal.
// Check if the user is navigating to another resource.
// If a modal exists, close close it.
watch(route, () => {
closeModal();
if (modals.modals[modalName]) {
closeModal();
}
});
</script>

0 comments on commit 07f589b

Please sign in to comment.