Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Dec 11, 2024
1 parent 8974c04 commit 4cc0c25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

### Pending Release

### v5.19.1 - 2024-12-10

- :rocket: `UI` Ensure switching to Admin Component doesn't throw an error

### v5.19.0 - 2024-12-10

- :rocket: `UI` Update Main Map to TS
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/CloudTAK/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ onMounted(async () => {
onBeforeUnmount(() => {
if (timer.value) window.clearInterval(timer.value);
if (timerSelf.value) window.clearInterval(timerSelf.value);
if (connectionStore.ws) connectionStore.ws.close();
connectionStore.destroy();
cotStore.$reset();
mapStore.destroy();
});
Expand Down
10 changes: 9 additions & 1 deletion api/web/src/stores/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,24 @@ const cotStore = useCOTStore();

export const useConnectionStore = defineStore('connection', {
state: (): {
destroyed: boolean
open: boolean
ws?: WebSocket
} => {
return {
destroyed: false,
open: false,
ws: undefined
}
},
actions: {
destroy: function() {
this.destroyed = true;
if (this.ws) this.ws.close();
},
connectSocket: function(connection: string) {
this.destroyed = false;

const url = stdurl('/api');
url.searchParams.append('format', 'geojson');
url.searchParams.append('connection', connection);
Expand All @@ -43,7 +51,7 @@ export const useConnectionStore = defineStore('connection', {

this.ws.addEventListener('close', () => {
// Otherwise the user is probably logged out
if (localStorage.token) this.connectSocket(connection);
if (localStorage.token && !this.destroyed) this.connectSocket(connection);

this.open = false;
});
Expand Down

0 comments on commit 4cc0c25

Please sign in to comment.