mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
fix(editor): Fix memory leak in Node Detail View by correctly unsubscribing from event buses (#6021)
This commit is contained in:
@@ -121,15 +121,8 @@ export default Vue.extend({
|
||||
mounted() {
|
||||
window.addEventListener('keydown', this.onWindowKeydown);
|
||||
|
||||
if (this.eventBus) {
|
||||
this.eventBus.on('close', () => {
|
||||
this.closeDialog();
|
||||
});
|
||||
|
||||
this.eventBus.on('closeAll', () => {
|
||||
this.uiStore.closeAllModals();
|
||||
});
|
||||
}
|
||||
this.eventBus?.on('close', this.closeDialog);
|
||||
this.eventBus?.on('closeAll', this.uiStore.closeAllModals);
|
||||
|
||||
const activeElement = document.activeElement as HTMLElement;
|
||||
if (activeElement) {
|
||||
@@ -137,6 +130,8 @@ export default Vue.extend({
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.eventBus?.off('close', this.closeDialog);
|
||||
this.eventBus?.off('closeAll', this.uiStore.closeAllModals);
|
||||
window.removeEventListener('keydown', this.onWindowKeydown);
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user