diff --git a/packages/shared/components/inputs/NetworkInput.svelte b/packages/shared/components/inputs/NetworkInput.svelte index 33c3ce20949..55851a61c0c 100644 --- a/packages/shared/components/inputs/NetworkInput.svelte +++ b/packages/shared/components/inputs/NetworkInput.svelte @@ -16,7 +16,8 @@ $: networkOptions = showLayer2 ? getLayer2NetworkOptions() : [LAYER_1_NETWORK_OPTION] - let selected: IOption = LAYER_1_NETWORK_OPTION + let selected: IOption = + getLayer2NetworkOptions().find((option) => option.value === networkAddress) ?? LAYER_1_NETWORK_OPTION $: if (!showLayer2) { selected = LAYER_1_NETWORK_OPTION } diff --git a/packages/shared/lib/core/utils/crypto/utils/validateEthereumAddress.ts b/packages/shared/lib/core/utils/crypto/utils/validateEthereumAddress.ts index 11c9e089da6..39fc3341c7a 100644 --- a/packages/shared/lib/core/utils/crypto/utils/validateEthereumAddress.ts +++ b/packages/shared/lib/core/utils/crypto/utils/validateEthereumAddress.ts @@ -8,6 +8,7 @@ import { KECCAK_HASH_SIZE } from '../constants' import { validateBech32Address } from './validateBech32Address' import { Layer1RecipientError } from '@core/layer-2/errors' import { InvalidAddressError } from '@auxiliary/deep-link' +import { localize } from '@core/i18n' export function validateEthereumAddress(address: string): void { throwIfBech32Address(address) @@ -45,7 +46,7 @@ function throwIfBech32Address(address: string): void { validateBech32Address(get(networkHrp), address) throw new Layer1RecipientError() } catch (err) { - if (err === new Layer1RecipientError()) { + if (err.message === localize('error.layer2.layer1Recipient')) { throw err } }