From 1371083e08563b94899478d6eee1d2ddb04b756b Mon Sep 17 00:00:00 2001 From: ingalls Date: Wed, 6 Mar 2024 16:25:21 -0700 Subject: [PATCH] Reset stores on unmount --- api/web/src/components/CloudTAK/Map.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/web/src/components/CloudTAK/Map.vue b/api/web/src/components/CloudTAK/Map.vue index 014cd978e..9ab68a5b5 100644 --- a/api/web/src/components/CloudTAK/Map.vue +++ b/api/web/src/components/CloudTAK/Map.vue @@ -120,10 +120,12 @@ import RadialMenu from './RadialMenu/RadialMenu.vue'; import moment from 'moment'; import { mapState, mapActions } from 'pinia' import { useMapStore } from '/src/stores/map.js'; +import { useOverlayStore } from '/src/stores/overlays.ts'; import { useProfileStore } from '/src/stores/profile.js'; import { useCOTStore } from '/src/stores/cots.js'; const cotStore = useCOTStore(); const mapStore = useMapStore(); +const overlayStore = useOverlayStore(); const profileStore = useProfileStore(); export default { @@ -148,6 +150,12 @@ export default { return !this.cot && !this.feat && !this.menu.main } }, + unmounted: function() { + cotStore.$reset(); + mapStore.$reset(); + overlayStore.$reset(); + profileStore.$reset(); + }, mounted: async function() { // ensure uncaught errors in the stack are captured into vue context window.addEventListener('error', (evt) => {