From bae344af430e1862c7e578ad84791c5a0e63fa97 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Mon, 7 Jul 2025 20:07:18 +1200 Subject: [PATCH] Fix smart account options validation for non-EIP4337 execution modes --- .../client/auth-options-form.client.tsx | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx index 6288aaa6b1f..83a01b97aa5 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx @@ -231,22 +231,24 @@ export function AuthOptionsForm({ } let smartAccountOptions: Ecosystem["smartAccountOptions"] | null = null; - if (data.useSmartAccount && data.executionMode === "EIP4337") { - let accountFactoryAddress: string; - switch (data.accountFactoryType) { - case "v0.6": - accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_6; - break; - case "v0.7": - accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_7; - break; - case "custom": - if (!data.customAccountFactoryAddress) { - toast.error("Please enter a custom account factory address"); - return; - } - accountFactoryAddress = data.customAccountFactoryAddress; - break; + if (data.useSmartAccount) { + let accountFactoryAddress: string | undefined; + if (data.executionMode === "EIP4337") { + switch (data.accountFactoryType) { + case "v0.6": + accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_6; + break; + case "v0.7": + accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_7; + break; + case "custom": + if (!data.customAccountFactoryAddress) { + toast.error("Please enter a custom account factory address"); + return; + } + accountFactoryAddress = data.customAccountFactoryAddress; + break; + } } smartAccountOptions = {