From 791045a54e1a2e63700acfb81222954566d7e551 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 5 Oct 2024 12:27:07 -0400 Subject: [PATCH] improved error when chain doesn't have polytone --- .../core/actions/CreateCrossChainAccount/Component.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/stateful/actions/core/actions/CreateCrossChainAccount/Component.tsx b/packages/stateful/actions/core/actions/CreateCrossChainAccount/Component.tsx index 412fc029f..a4fefb494 100644 --- a/packages/stateful/actions/core/actions/CreateCrossChainAccount/Component.tsx +++ b/packages/stateful/actions/core/actions/CreateCrossChainAccount/Component.tsx @@ -32,12 +32,15 @@ export const CreateCrossChainAccountComponent: ActionComponent = ({ if ( context.type !== ActionContextType.Dao || // Type check. - chainContext.type !== ActionChainContextType.Supported || - !chainContext.config.polytone + chainContext.type !== ActionChainContextType.Supported ) { throw new Error('Invalid context for this action.') } + if (!chainContext.config.polytone) { + throw new Error(`Cross-chain accounts have not been enabled for ${name}.`) + } + const missingChainIds = Object.keys(chainContext.config.polytone).filter( (chainId) => !(chainId in context.dao.info.polytoneProxies) )