Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jan 4, 2025
1 parent 6ccc0f0 commit ea6b9a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
border: none;
background: none;
font-size: 12px;
font-family: PingFang SC;
font-style: normal;
font-weight: 500;
color: var(--primary-color);
Expand Down
32 changes: 15 additions & 17 deletions packages/neuron-ui/src/components/ViewPrivateKey/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,29 @@ const ViewPrivateKey = ({ onClose, address }: { onClose?: () => void; address?:
)

const onSubmit = useCallback(
async (e?: React.FormEvent) => {
(e?: React.FormEvent) => {
if (e) {
e.preventDefault()
}
if (!password) {
return
}
setIsLoading(true)
try {
const res = await getPrivateKeyByAddress({
walletID,
address,
password,
getPrivateKeyByAddress({
walletID,
address,
password,
})
.then(res => {
if (!isSuccessResponse(res)) {
setError(errorFormatter(res.message, t))
return
}
setPrivateKey(res.result)
})
.finally(() => {
setIsLoading(false)
})

setIsLoading(false)

if (!isSuccessResponse(res)) {
setError(errorFormatter(res.message, t))
return
}
setPrivateKey(res.result)
} catch (err) {
setIsLoading(false)
}
},
[walletID, password, setError, t]
)
Expand Down
4 changes: 3 additions & 1 deletion packages/neuron-wallet/tests/services/address.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,9 @@ describe('integration tests for AddressService', () => {
const addresses = await wallet.checkAndGenerateAddresses(false, 5, 5)

if (addresses) {
const obj = addresses[Math.floor(Math.random() * addresses.length)]
const crypto = require('crypto')
const randomIndex = crypto.randomInt(addresses.length)
const obj = addresses[randomIndex]
address = obj.address
}

Expand Down

1 comment on commit ea6b9a7

@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 12611045611

Please sign in to comment.