From a383759fa831897b1668ad502c5885801dfcd9a6 Mon Sep 17 00:00:00 2001 From: ll__ Date: Tue, 6 Sep 2022 16:47:46 +0800 Subject: [PATCH] fix: replace network i18n issue (#1488) --- packages/kit/src/background/services/ServiceNameResolver.ts | 4 ++-- packages/kit/src/views/CreateWallet/AddExistingWallet.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/kit/src/background/services/ServiceNameResolver.ts b/packages/kit/src/background/services/ServiceNameResolver.ts index c1bb9945949..6ca830c6025 100644 --- a/packages/kit/src/background/services/ServiceNameResolver.ts +++ b/packages/kit/src/background/services/ServiceNameResolver.ts @@ -192,7 +192,7 @@ export default class ServiceNameResolver extends ServiceBase { return validNames; } catch (e) { - return 'form__address_unkonwn_error'; + return 'msg__network_request_failed'; } } @@ -207,7 +207,7 @@ export default class ServiceNameResolver extends ServiceBase { return null; } - return 'form__address_unkonwn_error'; + return 'msg__network_request_failed'; } } } diff --git a/packages/kit/src/views/CreateWallet/AddExistingWallet.tsx b/packages/kit/src/views/CreateWallet/AddExistingWallet.tsx index 829cad729b8..e99f0b12bf9 100644 --- a/packages/kit/src/views/CreateWallet/AddExistingWallet.tsx +++ b/packages/kit/src/views/CreateWallet/AddExistingWallet.tsx @@ -301,6 +301,7 @@ function AddExistingWalletView( showSubmitButton?: boolean; showPasteButton?: boolean; onNameServiceChange?: ReturnType['onChange']; + nameServiceAddress?: ReturnType['address']; }, ) { const { @@ -318,6 +319,7 @@ function AddExistingWalletView( showSubmitButton, showPasteButton, onNameServiceChange, + nameServiceAddress, } = props; const { @@ -341,7 +343,8 @@ function AddExistingWalletView( control={control} name="text" rules={{ - validate: async (text) => { + validate: async (t) => { + const text = nameServiceAddress || address || t; if (!text) { return true; } @@ -599,6 +602,7 @@ const AddExistingWallet = () => { {...viewProps} showPasteButton showSubmitButton={false} + nameServiceAddress={address} onNameServiceChange={onNameServiceChange} > {liteRecoveryButton}