Skip to content

Commit

Permalink
fix: keep network errors open unless manual closed and updated the copy
Browse files Browse the repository at this point in the history
  • Loading branch information
rickimoore committed Aug 3, 2023
1 parent 7800565 commit d0484c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/forms/ConfigConnectionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const ConfigConnectionForm: FC<ConfigConnectionFormProps> = ({ children }) => {
validatorClient,
)

const handleError = (e: unknown) => {
const handleError = (e: unknown, autoClose?: false | number) => {
let message = 'Unknown Error'
const requiredErrors = [
'beaconDataRequired',
Expand All @@ -162,7 +162,7 @@ const ConfigConnectionForm: FC<ConfigConnectionFormProps> = ({ children }) => {
if (e instanceof AxiosError && e.response?.status === 403) {
message = t('error.invalidApiToken')
}
displayToast(message, ToastType.ERROR)
displayToast(message, ToastType.ERROR, { autoClose })
}

const handleValidationErrors = (values: ConnectionForm) => {
Expand Down Expand Up @@ -285,11 +285,11 @@ const ConfigConnectionForm: FC<ConfigConnectionFormProps> = ({ children }) => {
} catch (e) {
if (!isValidBeaconNode || !isValidValidatorClient) {
if (!isValidBeaconNode) {
handleError('invalidBeacon')
handleError('invalidBeacon', false)
}

if (!isValidValidatorClient) {
handleError('invalidValidator')
handleError('invalidValidator', false)
}
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/locales/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
},
"invalidJson": "Invalid JSON data. Please ensure to use correct format.",
"executionFailure": "Execution broadcast failed. Please ensure all fields and signature are valid.",
"networkError": "{{type}} NODE NETWORK ERROR: Make sure your IP is correct and/or CORS is correctly configured. Use --http-allow-origin in {{type}} config",
"networkError": "{{type}} NODE NETWORK ERROR: Make sure your IP is correct and/or CORS is correctly configured. Use --http-allow-origin \"*\" in {{type}} config",
"unknownError": "Unknown {{type}} NODE error.",
"validatorInfo": "Error Loading Validator Info...",
"missingValidatorData": "Invalid Validator Node Data",
Expand Down

0 comments on commit d0484c5

Please sign in to comment.