SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
Refactor APIEndpoint Initialization Logic
Salman-Ahamed624eb1c5de18
diff --git a/packages/app/src/builder-ui/components/APIEndpoint.class.ts b/packages/app/src/builder-ui/components/APIEndpoint.class.tsindex cc849798..30f154dd 100644--- a/packages/app/src/builder-ui/components/APIEndpoint.class.ts+++ b/packages/app/src/builder-ui/components/APIEndpoint.class.ts@@ -24,8 +24,15 @@ export class APIEndpoint extends Component {private formPreviewButton: HTMLElement | null = null;protected async init() {- this.isNewComponent = Object.keys(this.data).length === 0;- // if it is a new component, it is on easy mode by default otherwise, if the advancedModeEnabled is not set, it is on advanced mode (for retro compatibility)+ // Check if this is a new component by filtering out auto-initialized properties+ // like 'templateVarToggleStates' which is added by the base Component class+ const dataKeysExcludingAutoInit = Object.keys(this.data).filter(+ (key) => key !== 'templateVarToggleStates',+ );+ this.isNewComponent = dataKeysExcludingAutoInit.length === 0;++ // If it is a new component, default to easy mode (advanced mode OFF).+ // Otherwise, use the saved advancedModeEnabled value, or default to true for retro compatibility.this.isOnAdvancedMode = this.isNewComponent? false: typeof this.data.advancedModeEnabled === 'boolean'