fix(editor): Remove push event listeners when migrating away from the canvas (#10063)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-07-15 17:25:32 +02:00
committed by GitHub
parent 3bde8453ef
commit 0d12f0a6b3

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, computed, watch, onBeforeMount, onMounted } from 'vue';
import { ref, computed, watch, onBeforeMount, onBeforeUnmount, onMounted } from 'vue';
import type { RouteLocation, RouteLocationRaw } from 'vue-router';
import { useRouter, useRoute } from 'vue-router';
import WorkflowDetails from '@/components/MainHeader/WorkflowDetails.vue';
@@ -57,6 +57,10 @@ onBeforeMount(() => {
pushConnection.initialize();
});
onBeforeUnmount(() => {
pushConnection.terminate();
});
onMounted(async () => {
dirtyState.value = uiStore.stateIsDirty;
syncTabsWithRoute(route);