tidying up
This commit is contained in:
+9
-16
@@ -1,17 +1,7 @@
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import {
|
||||
Button,
|
||||
Divider,
|
||||
Typography,
|
||||
TextField,
|
||||
InputAdornment,
|
||||
Grid,
|
||||
CircularProgress,
|
||||
Box,
|
||||
FormHelperText,
|
||||
} from '@mui/material';
|
||||
import { Button, Divider, Typography, TextField, InputAdornment, Grid, Box, FormHelperText } from '@mui/material';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { CurrencyDenom, MixNodeCostParams } from '@nymproject/types';
|
||||
import { CurrencyFormField } from '@nymproject/react/currency/CurrencyFormField';
|
||||
@@ -34,7 +24,6 @@ import { AppContext } from 'src/context';
|
||||
import { useGetFee } from 'src/hooks/useGetFee';
|
||||
import { ConfirmTx } from 'src/components/ConfirmTX';
|
||||
import { LoadingModal } from 'src/components/Modals/LoadingModal';
|
||||
import { getIntervalAsDate } from 'src/utils';
|
||||
|
||||
export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode }): JSX.Element => {
|
||||
const [openConfirmationModal, setOpenConfirmationModal] = useState<boolean>(false);
|
||||
@@ -62,9 +51,13 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
|
||||
defaultValues,
|
||||
});
|
||||
|
||||
const getCurrentInterval = async () => {
|
||||
const { nextEpoch } = await getIntervalAsDate();
|
||||
setNextEpoch(nextEpoch);
|
||||
const getNextInterval = async () => {
|
||||
try {
|
||||
const { nextInterval } = await getIntervalAsDate();
|
||||
setIntervalTime(nextInterval);
|
||||
} catch {
|
||||
console.log('cant retrieve next interval');
|
||||
}
|
||||
};
|
||||
|
||||
const getPendingEvents = async () => {
|
||||
@@ -88,7 +81,7 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getCurrentInterval();
|
||||
getNextInterval();
|
||||
getPendingEvents();
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user