diff --git a/src/modules/sendNotification/SendNotification.utils.tsx b/src/modules/sendNotification/SendNotification.utils.tsx index e15efe7e28..b50c6b088e 100644 --- a/src/modules/sendNotification/SendNotification.utils.tsx +++ b/src/modules/sendNotification/SendNotification.utils.tsx @@ -16,9 +16,13 @@ export const getChannelChainList = (channelDetails: ChannelDetails, account: str return [...aliases, appConfig.coreContractChain]; }; -export const getChannelDelegatesOptions = (delegatees: [ChannelDetails]) => { - if (delegatees && delegatees.length) { - return delegatees?.map((channel) => ({ +export const getChannelDelegatesOptions = ( + delegatees: [ChannelDetails], + channelDetails: ChannelDetails | undefined +) => { + const delegateesArray = [...(delegatees || []), ...(channelDetails ? [channelDetails] : [])]; + if (delegateesArray && delegateesArray.length) { + return delegateesArray?.map((channel) => ({ icon: ( { }; export const getChannelAddress = (channelOption: ChannelDetails, chainId: string, onCoreNetwork: boolean) => { - console.debug(channelOption); if (onCoreNetwork) return convertAddressToAddrCaip(channelOption.channel, parseInt(chainId)); else { const aliasAddress = diff --git a/src/modules/sendNotification/components/SendNotificationForm.tsx b/src/modules/sendNotification/components/SendNotificationForm.tsx index 3a675a028f..e95bc54f6a 100644 --- a/src/modules/sendNotification/components/SendNotificationForm.tsx +++ b/src/modules/sendNotification/components/SendNotificationForm.tsx @@ -41,13 +41,13 @@ const SendNotificationForm: FC = ({ channelDetails }) /** replace the delegatees with high level sdk function once it is available */ const { delegatees } = useSelector((state: any) => state.admin); const onCoreNetwork = CORE_CHAIN_ID === chainId; - const delegateesOptions = getChannelDelegatesOptions( - delegatees?.length ? delegatees : channelDetails ? [channelDetails] : [] - ); + + const delegateesOptions = getChannelDelegatesOptions(delegatees, channelDetails); const selectedChannel = - delegatees?.find((delegatee: ChannelDetails) => delegatee.channel === formik.values.channelAddress) || + delegatees?.find((delegatee: ChannelDetails) => delegatee.channel === delegateesOptions[0]?.value) || channelDetails; + const aliasChainOptions = getSelectChains(getChannelChainList(selectedChannel, account)); const formik = useFormik({