Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jul 12, 2024
1 parent 0559f90 commit 388da6c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const NetworkEditorDialog = ({
dataset: { field = '' },
} = e.target as HTMLInputElement
let error = ''
let fieldValue = value as string | number
let fieldValue: string | number = value
try {
if (field === 'name') {
validateNetworkName(value, usedNetworkNames)
Expand Down
12 changes: 6 additions & 6 deletions packages/neuron-ui/src/components/NetworkSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ const NetworkSetting = ({ chain = chainState, settings: { networks = [] } }: Sta
}
}, [currentId, networks])

const isInternalLightNode = (id: string) => id.includes('light_client')
const isInternalLightClient = (id: string) => id.includes('light_client')

const showNetworks = useMemo(() => {
const internalLightNodeId = lastShowInternalNodeIds.get(NetworkType.Light)
if (isInternalLightNode(internalLightNodeId)) {
return networks.filter(network => !isInternalLightNode(network.id) || network.id === internalLightNodeId)
if (isInternalLightClient(internalLightNodeId)) {
return networks.filter(network => !isInternalLightClient(network.id) || network.id === internalLightNodeId)
}
const index = networks.findIndex(network => isInternalLightNode(network.id))
return networks.filter((network, i) => !isInternalLightNode(network.id) || index === i)
const index = networks.findIndex(network => isInternalLightClient(network.id))
return networks.filter((network, i) => !isInternalLightClient(network.id) || index === i)
}, [currentId, networks])

return (
Expand All @@ -117,7 +117,7 @@ const NetworkSetting = ({ chain = chainState, settings: { networks = [] } }: Sta
),
suffix: (
<div className={styles.suffix}>
{currentId === network.id && isInternalLightNode(network.id) && network.type === NetworkType.Light ? (
{currentId === network.id && isInternalLightClient(network.id) && network.type === NetworkType.Light ? (
<Tooltip
tip={
<div>
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@
"main": {
"external-node-detected-dialog": {
"title": "Detected external node",
"body-tips-without-network": "You have selected the internal node but started the external node, if you want to continue to use the external node, please add a new network.",
"body-tips-without-network": "You have selected the internal node but started the external node, if you want to continue to use an external node, please add a new network.",
"body-tips-with-network": "You have currently selected an internal node but started an external node, if you need to continu using the external node please switch to another external network or add a new network.",
"add-network": "Add Network",
"ignore-external-node": "Ignore external node"
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@
"main": {
"external-node-detected-dialog": {
"title": "Nodo externo detectado",
"body-tips-without-network": "Has seleccionado el nodo interno pero has iniciado el nodo externo. Si deseas continuar usando el nodo externo, por favor añade una nueva red.",
"body-tips-without-network": "Has seleccionado el nodo interno pero has iniciado el nodo externo. Si deseas continuar usando un nodo externo, por favor añade una nueva red.",
"body-tips-with-network": "Actualmente has seleccionado un nodo interno pero has iniciado un nodo externo. Si necesitas continuar usando el nodo externo, por favor cambia a otra red externa o añade una nueva red.",
"add-network": "Agregar red",
"ignore-external-node": "Ignorar nodo externo"
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@
"main": {
"external-node-detected-dialog": {
"title": "Détection d'un noeud externe",
"body-tips-without-network": "Vous avez sélectionné le nœud interne mais démarré le nœud externe. Si vous souhaitez continuer à utiliser le nœud externe, veuillez ajouter un nouveau réseau.",
"body-tips-without-network": "Vous avez sélectionné le nœud interne mais démarré le nœud externe. Si vous souhaitez continuer à utiliser un nœud externe, veuillez ajouter un nouveau réseau.",
"body-tips-with-network": "Vous avez actuellement sélectionné un nœud interne mais démarré un nœud externe. Si vous avez besoin de continuer à utiliser le nœud externe, veuillez passer à un autre réseau externe ou ajouter un nouveau réseau.",
"add-network": "Ajouter un réseau",
"ignore-external-node": "Ignorer le noeud externe"
Expand Down

1 comment on commit 388da6c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 9905445838

Please sign in to comment.