Skip to content

Commit c67aa36

Browse files
committed
feat(neuron-ui): remove redundant error messages
1 parent e88dc38 commit c67aa36

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/neuron-ui/src/components/ImportKeystore/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ const ImportKeystore = (props: React.PropsWithoutRef<StateWithDispatch & RouteCo
105105
return t(`messages.codes.${ErrorCode.FieldRequired}`, { fieldName: `keystore-${key}` })
106106
}
107107
if (key === 'name' && isNameUsed) {
108-
return t(`messages.codes.${ErrorCode.FieldUsed}`, { fieldName: `name`, fieldValue: text })
108+
return t(`messages.codes.${ErrorCode.FieldUsed}`, { fieldName: `keystore-name`, fieldValue: '' })
109109
}
110110
if (text && maxLength && text.length > maxLength) {
111111
return t(`messages.codes.${ErrorCode.FieldTooLong}`, {
112-
fieldName: key,
113-
fieldValue: key === 'password' ? '' : text,
112+
fieldName: `keystore-${key}`,
113+
fieldValue: '',
114114
length: maxLength,
115115
})
116116
}

packages/neuron-ui/src/components/NetworkEditor/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const useInputs = (editor: EditorType, usedNetworkNames: string[], t: any
108108
if (typeof res === 'object') {
109109
return t(`messages.codes.${res.code}`, {
110110
fieldName: 'name',
111-
fieldValue: name,
111+
fieldValue: '',
112112
length: MAX_NETWORK_NAME_LENGTH,
113113
})
114114
}

0 commit comments

Comments
 (0)