refactor(editor): Do not make rest api calls for disabled features (no-changelog) (#9046)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-04-04 15:53:34 +02:00
committed by GitHub
parent 217b07d735
commit 637b6c4d3e
5 changed files with 28 additions and 17 deletions

View File

@@ -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());