Skip to content

Commit

Permalink
chore: fallback to first cross-chain backup address
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Dec 16, 2024
1 parent 5ff7f79 commit 6e3c50e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/components/SetupPage/Create/SetupCreateSafe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -64,6 +65,9 @@ export const SetupCreateSafe = () => {
refetch: updateWallets,
isFetched: isWalletsFetched,
} = useMasterWalletContext();

const { allBackupAddresses } = useMultisigs();

const { backupSigner } = useSetup();

const masterSafeAddress = useMemo(() => {
Expand All @@ -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?.();
Expand Down

0 comments on commit 6e3c50e

Please sign in to comment.