Skip to content

Commit 20e323d

Browse files
[Dashboard] Fix smart account options validation for non-EIP4337 execution modes (#7537)
1 parent 0ec6142 commit 20e323d

File tree

1 file changed

+18
-16
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client

1 file changed

+18
-16
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,22 +231,24 @@ export function AuthOptionsForm({
231231
}
232232

233233
let smartAccountOptions: Ecosystem["smartAccountOptions"] | null = null;
234-
if (data.useSmartAccount && data.executionMode === "EIP4337") {
235-
let accountFactoryAddress: string;
236-
switch (data.accountFactoryType) {
237-
case "v0.6":
238-
accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_6;
239-
break;
240-
case "v0.7":
241-
accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_7;
242-
break;
243-
case "custom":
244-
if (!data.customAccountFactoryAddress) {
245-
toast.error("Please enter a custom account factory address");
246-
return;
247-
}
248-
accountFactoryAddress = data.customAccountFactoryAddress;
249-
break;
234+
if (data.useSmartAccount) {
235+
let accountFactoryAddress: string | undefined;
236+
if (data.executionMode === "EIP4337") {
237+
switch (data.accountFactoryType) {
238+
case "v0.6":
239+
accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_6;
240+
break;
241+
case "v0.7":
242+
accountFactoryAddress = DEFAULT_ACCOUNT_FACTORY_V0_7;
243+
break;
244+
case "custom":
245+
if (!data.customAccountFactoryAddress) {
246+
toast.error("Please enter a custom account factory address");
247+
return;
248+
}
249+
accountFactoryAddress = data.customAccountFactoryAddress;
250+
break;
251+
}
250252
}
251253

252254
smartAccountOptions = {

0 commit comments

Comments
 (0)