mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Setup push connection in NodeView (no-changelog) (#7821)
This commit is contained in:
parent
75a5807c72
commit
2807ddcd0d
|
@ -56,7 +56,6 @@ import {
|
||||||
useCloudPlanStore,
|
useCloudPlanStore,
|
||||||
useSourceControlStore,
|
useSourceControlStore,
|
||||||
useUsageStore,
|
useUsageStore,
|
||||||
usePushConnectionStore,
|
|
||||||
} from '@/stores';
|
} from '@/stores';
|
||||||
import { useHistoryHelper } from '@/composables/useHistoryHelper';
|
import { useHistoryHelper } from '@/composables/useHistoryHelper';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
@ -93,7 +92,6 @@ export default defineComponent({
|
||||||
useSourceControlStore,
|
useSourceControlStore,
|
||||||
useCloudPlanStore,
|
useCloudPlanStore,
|
||||||
useUsageStore,
|
useUsageStore,
|
||||||
usePushConnectionStore,
|
|
||||||
),
|
),
|
||||||
defaultLocale(): string {
|
defaultLocale(): string {
|
||||||
return this.rootStore.defaultLocale;
|
return this.rootStore.defaultLocale;
|
||||||
|
@ -122,7 +120,6 @@ export default defineComponent({
|
||||||
void initializeAuthenticatedFeatures();
|
void initializeAuthenticatedFeatures();
|
||||||
|
|
||||||
void runExternalHook('app.mount');
|
void runExternalHook('app.mount');
|
||||||
this.pushStore.pushConnect();
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -149,6 +149,7 @@ export const usePushConnectionStore = defineStore(STORES.PUSH, () => {
|
||||||
isConnectionOpen,
|
isConnectionOpen,
|
||||||
addEventListener,
|
addEventListener,
|
||||||
pushConnect,
|
pushConnect,
|
||||||
|
pushDisconnect,
|
||||||
send,
|
send,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -331,6 +331,7 @@ import {
|
||||||
useHistoryStore,
|
useHistoryStore,
|
||||||
useExternalSecretsStore,
|
useExternalSecretsStore,
|
||||||
useCollaborationStore,
|
useCollaborationStore,
|
||||||
|
usePushConnectionStore,
|
||||||
} from '@/stores';
|
} from '@/stores';
|
||||||
import * as NodeViewUtils from '@/utils/nodeViewUtils';
|
import * as NodeViewUtils from '@/utils/nodeViewUtils';
|
||||||
import { getAccountAge, getConnectionInfo, getNodeViewTab } from '@/utils';
|
import { getAccountAge, getConnectionInfo, getNodeViewTab } from '@/utils';
|
||||||
|
@ -560,6 +561,7 @@ export default defineComponent({
|
||||||
useHistoryStore,
|
useHistoryStore,
|
||||||
useExternalSecretsStore,
|
useExternalSecretsStore,
|
||||||
useCollaborationStore,
|
useCollaborationStore,
|
||||||
|
usePushConnectionStore,
|
||||||
),
|
),
|
||||||
nativelyNumberSuffixedDefaults(): string[] {
|
nativelyNumberSuffixedDefaults(): string[] {
|
||||||
return this.nodeTypesStore.nativelyNumberSuffixedDefaults;
|
return this.nodeTypesStore.nativelyNumberSuffixedDefaults;
|
||||||
|
@ -4674,6 +4676,11 @@ export default defineComponent({
|
||||||
dataPinningEventBus.off('unpin-data', this.removePinDataConnections);
|
dataPinningEventBus.off('unpin-data', this.removePinDataConnections);
|
||||||
nodeViewEventBus.off('saveWorkflow', this.saveCurrentWorkflowExternal);
|
nodeViewEventBus.off('saveWorkflow', this.saveCurrentWorkflowExternal);
|
||||||
},
|
},
|
||||||
|
beforeMount() {
|
||||||
|
if (!this.isDemo) {
|
||||||
|
this.pushStore.pushConnect();
|
||||||
|
}
|
||||||
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
// Make sure the event listeners get removed again else we
|
// Make sure the event listeners get removed again else we
|
||||||
// could add up with them registered multiple times
|
// could add up with them registered multiple times
|
||||||
|
@ -4681,6 +4688,10 @@ export default defineComponent({
|
||||||
document.removeEventListener('keyup', this.keyUp);
|
document.removeEventListener('keyup', this.keyUp);
|
||||||
this.unregisterCustomAction('showNodeCreator');
|
this.unregisterCustomAction('showNodeCreator');
|
||||||
|
|
||||||
|
if (!this.isDemo) {
|
||||||
|
this.pushStore.pushDisconnect();
|
||||||
|
}
|
||||||
|
|
||||||
this.resetWorkspace();
|
this.resetWorkspace();
|
||||||
this.instance.unbind();
|
this.instance.unbind();
|
||||||
this.instance.destroy();
|
this.instance.destroy();
|
||||||
|
|
Loading…
Reference in a new issue