Explorar o código

feat(ServerAnalytic): add websocket cleanup on component unmount

Co-Authored-By: woncode <20252778+woncode@users.noreply.github.com>
Jacky hai 1 mes
pai
achega
118dff1b82
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      app/src/views/dashboard/ServerAnalytic.vue

+ 4 - 0
app/src/views/dashboard/ServerAnalytic.vue

@@ -90,6 +90,10 @@ onMounted(() => {
   })
 })
 
+onUnmounted(() => {
+  websocket?.close()
+})
+
 function handle_uptime(t: number) {
   // uptime
   let _uptime = Math.floor(t)