mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
refactor(editor): Do not make rest api calls for disabled features (no-changelog) (#9046)
This commit is contained in:
parent
217b07d735
commit
637b6c4d3e
|
@ -24,15 +24,17 @@ export async function initializeCore() {
|
|||
const versionsStore = useVersionsStore();
|
||||
|
||||
await settingsStore.initialize();
|
||||
await usersStore.initialize();
|
||||
if (!settingsStore.isPreviewMode) {
|
||||
await usersStore.initialize();
|
||||
|
||||
void versionsStore.checkForNewVersions();
|
||||
void versionsStore.checkForNewVersions();
|
||||
|
||||
if (settingsStore.isCloudDeployment) {
|
||||
try {
|
||||
await initializeCloudHooks();
|
||||
} catch (e) {
|
||||
console.error('Failed to initialize cloud hooks:', e);
|
||||
if (settingsStore.isCloudDeployment) {
|
||||
try {
|
||||
await initializeCloudHooks();
|
||||
} catch (e) {
|
||||
console.error('Failed to initialize cloud hooks:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -809,16 +809,22 @@ export default defineComponent({
|
|||
this.clipboard.onPaste.value = this.onClipboardPasteEvent;
|
||||
|
||||
this.canvasStore.startLoading();
|
||||
const loadPromises =
|
||||
this.settingsStore.isPreviewMode && this.isDemo
|
||||
? []
|
||||
: [
|
||||
this.loadActiveWorkflows(),
|
||||
this.loadCredentials(),
|
||||
this.loadCredentialTypes(),
|
||||
this.loadVariables(),
|
||||
this.loadSecrets(),
|
||||
];
|
||||
|
||||
const loadPromises = (() => {
|
||||
if (this.settingsStore.isPreviewMode && this.isDemo) return [];
|
||||
const promises = [
|
||||
this.loadActiveWorkflows(),
|
||||
this.loadCredentials(),
|
||||
this.loadCredentialTypes(),
|
||||
];
|
||||
if (this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Variables)) {
|
||||
promises.push(this.loadVariables());
|
||||
}
|
||||
if (this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.ExternalSecrets)) {
|
||||
promises.push(this.loadSecrets());
|
||||
}
|
||||
return promises;
|
||||
})();
|
||||
|
||||
if (this.nodeTypesStore.allNodeTypes.length === 0) {
|
||||
loadPromises.push(this.loadNodeTypes());
|
||||
|
|
|
@ -19,6 +19,7 @@ const sortedProviders = computed(() => {
|
|||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (!externalSecretsStore.isEnterpriseExternalSecretsEnabled) return;
|
||||
try {
|
||||
void externalSecretsStore.fetchAllSecrets();
|
||||
void externalSecretsStore.getProviders();
|
||||
|
|
|
@ -112,6 +112,7 @@ const initialize = async () => {
|
|||
};
|
||||
|
||||
onMounted(async () => {
|
||||
if (!sourceControlStore.isEnterpriseSourceControlEnabled) return;
|
||||
await initialize();
|
||||
});
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ function resetNewVariablesList() {
|
|||
}
|
||||
|
||||
async function initialize() {
|
||||
if (!isFeatureEnabled.value) return;
|
||||
await environmentsStore.fetchAllVariables();
|
||||
|
||||
allVariables.value = [...environmentsStore.variables];
|
||||
|
|
Loading…
Reference in a new issue