Skip to content

Commit

Permalink
Add fallback name
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Dec 2, 2024
1 parent 322f47d commit cc3c894
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { useVisibleBalances } from '@/hooks/useVisibleBalances'
import { AutocompleteItem } from '@/components/tx-flow/flows/TokenTransfer/CreateTokenTransfer'
import { validateDecimalLength, validateLimitedAmount } from '@/utils/validation'
import { safeFormatUnits } from '@/utils/formatters'
import { useMnemonicSafeName } from '@/hooks/useMnemonicName'

import css from '@/components/tx-flow/flows/CreateSubaccount/styles.module.css'
import commonCss from '@/components/tx-flow/common/styles.module.css'
Expand Down Expand Up @@ -57,7 +58,8 @@ export function SetUpSubaccount({
}) {
const addressBook = useAddressBook()
const safeAddress = useSafeAddress()
const fallbackName = `${addressBook[safeAddress]} Subaccount`
const randomName = useMnemonicSafeName()
const fallbackName = `${addressBook[safeAddress] ?? randomName} Subaccount`

const formMethods = useForm<SetupSubaccountForm>({
defaultValues: params,
Expand Down

0 comments on commit cc3c894

Please sign in to comment.