Skip to content

Commit

Permalink
fix(editor): Remove push event listeners when migrating away from the…
Browse files Browse the repository at this point in the history
… canvas (n8n-io#10063)
  • Loading branch information
netroy authored Jul 15, 2024
1 parent 3bde845 commit 0d12f0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor-ui/src/components/MainHeader/MainHeader.vue
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -57,6 +57,10 @@ onBeforeMount(() => {
pushConnection.initialize();
});
onBeforeUnmount(() => {
pushConnection.terminate();
});
onMounted(async () => {
dirtyState.value = uiStore.stateIsDirty;
syncTabsWithRoute(route);
Expand Down

0 comments on commit 0d12f0a

Please sign in to comment.