diff --git a/packages/mobile/routes/login/views/EnterPinView.svelte b/packages/mobile/routes/login/views/EnterPinView.svelte index 6af9e5ee96..7df5a68c45 100644 --- a/packages/mobile/routes/login/views/EnterPinView.svelte +++ b/packages/mobile/routes/login/views/EnterPinView.svelte @@ -6,7 +6,7 @@ import { loginRouter } from '../../../lib/core/router' import { Platform } from '@lib/platform' import { openPopup, popupState } from '@auxiliary/popup' - import { validatePinFormat } from '@lib/utils' + import { isValidPin } from '@core/utils' import { Icon, PinInput, Profile, Text, TextType } from 'shared/components' import { onDestroy } from 'svelte' @@ -34,7 +34,7 @@ $: hasReachedMaxAttempts = attempts >= MAX_PINCODE_INCORRECT_ATTEMPTS $: { - if (validatePinFormat(pinCode)) { + if (isValidPin(pinCode)) { void onSubmitClick() } } diff --git a/packages/mobile/routes/onboarding/views/storage-protection-setup/views/SetupPinProtectionView.svelte b/packages/mobile/routes/onboarding/views/storage-protection-setup/views/SetupPinProtectionView.svelte index 2efd2f52aa..296155a576 100644 --- a/packages/mobile/routes/onboarding/views/storage-protection-setup/views/SetupPinProtectionView.svelte +++ b/packages/mobile/routes/onboarding/views/storage-protection-setup/views/SetupPinProtectionView.svelte @@ -11,14 +11,10 @@ import { localize } from '@core/i18n' import { pollLedgerNanoStatus, stopPollingLedgerNanoStatus } from '@core/ledger' import { ProfileType } from '@core/profile' - import { storageProtectionSetupRouter } from '../../../../../lib/core/router' - import { validatePinFormat } from '@lib/utils' + import { isValidPin } from '@core/utils' import { onMount } from 'svelte' - export let busy = false - const title = localize('views.onboarding.storageProtectionSetup.setupPinProtection.title') - let setPinInput = '' let setPinInputError = '' let confirmPinInput = '' @@ -31,7 +27,7 @@ $: setPinInput, (setPinInputError = '') $: confirmPinInput, (confirmPinInputError = '') $: arePinInputsMatching = setPinInput === confirmPinInput - $: arePinInputsValid = validatePinFormat(setPinInput) && validatePinFormat(confirmPinInput) + $: arePinInputsValid = isValidPin(setPinInput) && isValidPin(confirmPinInput) $: if (arePinInputsValid && !arePinInputsMatching) { confirmPinInputError = localize('error.pincode.match') } else { diff --git a/packages/shared/components/Button.svelte b/packages/shared/components/Button.svelte index 0946c99eb4..13f7d521ce 100644 --- a/packages/shared/components/Button.svelte +++ b/packages/shared/components/Button.svelte @@ -2,7 +2,7 @@ import { ButtonSize, ButtonVariant, HTMLButtonType, Icon, Spinner } from 'shared/components' import { onMount } from 'svelte' import { appSettings } from '@core/app' - import { bindEvents, debounce } from '@lib/utils' + import { bindEvents, debounce } from '@core/utils' import { Icon as IconEnum } from '@lib/auxiliary/icon' import type { Event } from '@lib/typings/events' diff --git a/packages/shared/components/CopyButton.svelte b/packages/shared/components/CopyButton.svelte index 5a9d4f9324..cc5b4c649a 100644 --- a/packages/shared/components/CopyButton.svelte +++ b/packages/shared/components/CopyButton.svelte @@ -1,5 +1,5 @@