From 95a35cc5cb077ebdb11896afe79d1a334b54e72a Mon Sep 17 00:00:00 2001 From: sophian Date: Thu, 17 Oct 2024 11:37:52 -0400 Subject: [PATCH] Fix onboarding signer --- centrifuge-app/src/components/OnboardingAuthProvider.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/centrifuge-app/src/components/OnboardingAuthProvider.tsx b/centrifuge-app/src/components/OnboardingAuthProvider.tsx index 4c15f1bb01..91b7769afe 100644 --- a/centrifuge-app/src/components/OnboardingAuthProvider.tsx +++ b/centrifuge-app/src/components/OnboardingAuthProvider.tsx @@ -59,12 +59,13 @@ export function OnboardingAuthProvider({ children }: { children: React.ReactNode const { mutate: login, isLoading: isLoggingIn } = useMutation(async () => { try { + const signer = await provider?.getSigner() if (selectedAccount?.address && selectedWallet?.signer) { await loginWithSubstrate(selectedAccount?.address, selectedWallet.signer as Signer, cent, proxy) - } else if (isEvmOnSubstrate && selectedAddress && provider?.getSigner()) { - await loginWithEvm(selectedAddress, provider.getSigner(), evmChainId, isEvmOnSubstrate) - } else if (selectedAddress && provider?.getSigner()) { - await loginWithEvm(selectedAddress, provider.getSigner(), evm.chainId) + } else if (isEvmOnSubstrate && selectedAddress && signer) { + await loginWithEvm(selectedAddress, signer, evmChainId, isEvmOnSubstrate) + } else if (selectedAddress && signer) { + await loginWithEvm(selectedAddress, signer, evm.chainId) } throw new Error('network not supported') } catch {