From 6e3c50ebfc92e596ecb8d1a215ce461957ca5aad Mon Sep 17 00:00:00 2001 From: truemiller Date: Mon, 16 Dec 2024 15:39:41 +0000 Subject: [PATCH] chore: fallback to first cross-chain backup address --- frontend/components/SetupPage/Create/SetupCreateSafe.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/components/SetupPage/Create/SetupCreateSafe.tsx b/frontend/components/SetupPage/Create/SetupCreateSafe.tsx index c5ddd616b..ab7843f89 100644 --- a/frontend/components/SetupPage/Create/SetupCreateSafe.tsx +++ b/frontend/components/SetupPage/Create/SetupCreateSafe.tsx @@ -9,6 +9,7 @@ import { UNICODE_SYMBOLS } from '@/constants/symbols'; import { SUPPORT_URL } from '@/constants/urls'; import { EvmChainName } from '@/enums/Chain'; import { Pages } from '@/enums/Pages'; +import { useMultisigs } from '@/hooks/useMultisig'; import { usePageState } from '@/hooks/usePageState'; import { useServices } from '@/hooks/useServices'; import { useSetup } from '@/hooks/useSetup'; @@ -64,6 +65,9 @@ export const SetupCreateSafe = () => { refetch: updateWallets, isFetched: isWalletsFetched, } = useMasterWalletContext(); + + const { allBackupAddresses } = useMultisigs(); + const { backupSigner } = useSetup(); const masterSafeAddress = useMemo(() => { @@ -83,7 +87,10 @@ export const SetupCreateSafe = () => { for (let attempt = retries; attempt > 0; attempt--) { try { // Attempt to create the safe - await WalletService.createSafe(middlewareChain, backupSigner); + await WalletService.createSafe( + middlewareChain, + backupSigner ?? allBackupAddresses[0], + ); // Update wallets and handle successful creation await updateWallets?.();