mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -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,6 +24,7 @@ export async function initializeCore() {
|
|||
const versionsStore = useVersionsStore();
|
||||
|
||||
await settingsStore.initialize();
|
||||
if (!settingsStore.isPreviewMode) {
|
||||
await usersStore.initialize();
|
||||
|
||||
void versionsStore.checkForNewVersions();
|
||||
|
@ -35,6 +36,7 @@ export async function initializeCore() {
|
|||
console.error('Failed to initialize cloud hooks:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
coreInitialized = true;
|
||||
}
|
||||
|
|
|
@ -809,16 +809,22 @@ export default defineComponent({
|
|||
this.clipboard.onPaste.value = this.onClipboardPasteEvent;
|
||||
|
||||
this.canvasStore.startLoading();
|
||||
const loadPromises =
|
||||
this.settingsStore.isPreviewMode && this.isDemo
|
||||
? []
|
||||
: [
|
||||
|
||||
const loadPromises = (() => {
|
||||
if (this.settingsStore.isPreviewMode && this.isDemo) return [];
|
||||
const promises = [
|
||||
this.loadActiveWorkflows(),
|
||||
this.loadCredentials(),
|
||||
this.loadCredentialTypes(),
|
||||
this.loadVariables(),
|
||||
this.loadSecrets(),
|
||||
];
|
||||
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