Skip to content

Commit

Permalink
Reset stores on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Mar 6, 2024
1 parent ae18230 commit 1371083
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/web/src/components/CloudTAK/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) => {
Expand Down

0 comments on commit 1371083

Please sign in to comment.