strip off v in node version
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { clean } from 'semver';
|
||||
import { Checkbox, FormControlLabel, Stack, TextField } from '@mui/material';
|
||||
import { IdentityKeyFormField } from '@nymproject/react/mixnodes/IdentityKeyFormField';
|
||||
import { yupResolver } from '@hookform/resolvers/yup/dist/yup';
|
||||
@@ -24,7 +25,13 @@ const GatewayInitForm = ({
|
||||
|
||||
const handleRequestValidation = (event: { detail: { step: number } }) => {
|
||||
if (event.detail.step === 1) {
|
||||
handleSubmit(onNext)();
|
||||
handleSubmit((data) => {
|
||||
const validatedData = {
|
||||
...data,
|
||||
version: clean(data.version) as string,
|
||||
};
|
||||
onNext(validatedData);
|
||||
})();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { clean } from 'semver';
|
||||
import { Checkbox, FormControlLabel, Stack, TextField } from '@mui/material';
|
||||
import { IdentityKeyFormField } from '@nymproject/react/mixnodes/IdentityKeyFormField';
|
||||
import { yupResolver } from '@hookform/resolvers/yup/dist/yup';
|
||||
@@ -18,7 +19,13 @@ const MixnodeInitForm = ({ mixnodeData, onNext }: { mixnodeData: MixnodeData; on
|
||||
|
||||
const handleRequestValidation = (event: { detail: { step: number } }) => {
|
||||
if (event.detail.step === 1) {
|
||||
handleSubmit(onNext)();
|
||||
handleSubmit((data) => {
|
||||
const validatedData = {
|
||||
...data,
|
||||
version: clean(data.version),
|
||||
};
|
||||
onNext(validatedData);
|
||||
})();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { clean } from 'semver';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { Button, Divider, Typography, TextField, Grid, Box } from '@mui/material';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
@@ -50,7 +51,7 @@ export const GeneralGatewaySettings = ({ bondedNode }: { bondedNode: TBondedGate
|
||||
host,
|
||||
mix_port: mixPort,
|
||||
location,
|
||||
version,
|
||||
version: clean(version) as string,
|
||||
clients_port: httpApiPort,
|
||||
verloc_port: bondedNode.verlocPort,
|
||||
};
|
||||
@@ -208,7 +209,7 @@ export const GeneralGatewaySettings = ({ bondedNode }: { bondedNode: TBondedGate
|
||||
<SimpleModal
|
||||
open={openConfirmationModal}
|
||||
header="Your changes are submitted to the blockchain"
|
||||
subHeader="Remember to change the values
|
||||
subHeader="Remember to change the values
|
||||
on your gateways’s config file too."
|
||||
okLabel="close"
|
||||
hideCloseIcon
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { clean } from 'semver';
|
||||
import { Button, Divider, Grid, Stack, TextField, Typography } from '@mui/material';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { isMixnode } from 'src/types';
|
||||
@@ -46,7 +47,7 @@ export const GeneralMixnodeSettings = ({ bondedNode }: { bondedNode: TBondedMixn
|
||||
mix_port: mixPort,
|
||||
verloc_port: verlocPort,
|
||||
http_api_port: httpApiPort,
|
||||
version,
|
||||
version: clean(version) as string,
|
||||
};
|
||||
try {
|
||||
if (bondedNode.proxy) {
|
||||
|
||||
Reference in New Issue
Block a user