mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): SettingsSidebar should disconnect from push when navigating away (#6025)
This commit is contained in:
parent
4037b3aeed
commit
41660d9e28
|
@ -24,7 +24,6 @@
|
||||||
import mixins from 'vue-typed-mixins';
|
import mixins from 'vue-typed-mixins';
|
||||||
import { ABOUT_MODAL_KEY, VERSIONS_MODAL_KEY, VIEWS } from '@/constants';
|
import { ABOUT_MODAL_KEY, VERSIONS_MODAL_KEY, VIEWS } from '@/constants';
|
||||||
import { userHelpers } from '@/mixins/userHelpers';
|
import { userHelpers } from '@/mixins/userHelpers';
|
||||||
import { pushConnection } from '@/mixins/pushConnection';
|
|
||||||
import { IFakeDoor } from '@/Interface';
|
import { IFakeDoor } from '@/Interface';
|
||||||
import { IMenuItem } from 'n8n-design-system';
|
import { IMenuItem } from 'n8n-design-system';
|
||||||
import { BaseTextKey } from '@/plugins/i18n';
|
import { BaseTextKey } from '@/plugins/i18n';
|
||||||
|
@ -33,7 +32,7 @@ import { useUIStore } from '@/stores/ui';
|
||||||
import { useSettingsStore } from '@/stores/settings';
|
import { useSettingsStore } from '@/stores/settings';
|
||||||
import { useRootStore } from '@/stores/n8nRootStore';
|
import { useRootStore } from '@/stores/n8nRootStore';
|
||||||
|
|
||||||
export default mixins(userHelpers, pushConnection).extend({
|
export default mixins(userHelpers).extend({
|
||||||
name: 'SettingsSidebar',
|
name: 'SettingsSidebar',
|
||||||
computed: {
|
computed: {
|
||||||
...mapStores(useRootStore, useSettingsStore, useUIStore),
|
...mapStores(useRootStore, useSettingsStore, useUIStore),
|
||||||
|
@ -134,9 +133,6 @@ export default mixins(userHelpers, pushConnection).extend({
|
||||||
return menuItems;
|
return menuItems;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.pushConnect();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
canAccessPersonalSettings(): boolean {
|
canAccessPersonalSettings(): boolean {
|
||||||
return this.canUserAccessRouteByName(VIEWS.PERSONAL_SETTINGS);
|
return this.canUserAccessRouteByName(VIEWS.PERSONAL_SETTINGS);
|
||||||
|
|
|
@ -59,6 +59,7 @@ import {
|
||||||
} from '@/constants';
|
} from '@/constants';
|
||||||
import CommunityPackageCard from '@/components/CommunityPackageCard.vue';
|
import CommunityPackageCard from '@/components/CommunityPackageCard.vue';
|
||||||
import { showMessage } from '@/mixins/showMessage';
|
import { showMessage } from '@/mixins/showMessage';
|
||||||
|
import { pushConnection } from '@/mixins/pushConnection';
|
||||||
import mixins from 'vue-typed-mixins';
|
import mixins from 'vue-typed-mixins';
|
||||||
import { PublicInstalledPackage } from 'n8n-workflow';
|
import { PublicInstalledPackage } from 'n8n-workflow';
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ import { BaseTextKey } from '@/plugins/i18n';
|
||||||
|
|
||||||
const PACKAGE_COUNT_THRESHOLD = 31;
|
const PACKAGE_COUNT_THRESHOLD = 31;
|
||||||
|
|
||||||
export default mixins(showMessage).extend({
|
export default mixins(showMessage, pushConnection).extend({
|
||||||
name: 'SettingsCommunityNodesView',
|
name: 'SettingsCommunityNodesView',
|
||||||
components: {
|
components: {
|
||||||
CommunityPackageCard,
|
CommunityPackageCard,
|
||||||
|
@ -81,6 +82,9 @@ export default mixins(showMessage).extend({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
// The push connection is needed here to receive `reloadNodeType` and `removeNodeType` events when community nodes are installed, updated, or removed.
|
||||||
|
this.pushConnect();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.$data.loading = true;
|
this.$data.loading = true;
|
||||||
await this.communityNodesStore.fetchInstalledPackages();
|
await this.communityNodesStore.fetchInstalledPackages();
|
||||||
|
@ -124,6 +128,9 @@ export default mixins(showMessage).extend({
|
||||||
this.$data.loading = false;
|
this.$data.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.pushDisconnect();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapStores(useCommunityNodesStore, useSettingsStore, useUIStore),
|
...mapStores(useCommunityNodesStore, useSettingsStore, useUIStore),
|
||||||
getEmptyStateDescription(): string {
|
getEmptyStateDescription(): string {
|
||||||
|
|
Loading…
Reference in a new issue