remove isValidatorSet

This commit is contained in:
Hristo Nedelkov 2023-10-10 10:52:26 +03:00
parent d56383fca5
commit cff1ddf0d7
3 changed files with 19 additions and 23 deletions

View File

@ -8,7 +8,7 @@ import ValidatorsMenuWithPrice from '../../../components/General/ValidatorsMenuW
import { CLIENT_SETUP_SUBTITLE } from '../../../constants' import { CLIENT_SETUP_SUBTITLE } from '../../../constants'
const ClientSetup = () => { const ClientSetup = () => {
const [isValidatorSet, setIsValidatorSet] = useState(false) const [ , setIsValidatorSet] = useState(false)
const [validatorCount, setValidatorCount] = useState(0) const [validatorCount, setValidatorCount] = useState(0)
useEffect(() => { useEffect(() => {
setIsValidatorSet(validatorCount > 0) setIsValidatorSet(validatorCount > 0)

View File

@ -17,7 +17,7 @@ import {
} from '../../redux/ValidatorOnboarding/KeyGeneration/slice' } from '../../redux/ValidatorOnboarding/KeyGeneration/slice'
import { import {
setSubStepAdvisories, setSubStepAdvisories,
setIsAdvisoriesComplete,
} from '../../redux/ValidatorOnboarding/Advisories/slice' } from '../../redux/ValidatorOnboarding/Advisories/slice'
const ContinueButton = () => { const ContinueButton = () => {
@ -34,7 +34,7 @@ const ContinueButton = () => {
const { activeStep, subStepValidatorSetup } = useSelector( const { activeStep, subStepValidatorSetup } = useSelector(
(state: RootState) => state.validatorOnboarding, (state: RootState) => state.validatorOnboarding,
) )
const { subStepAdvisories, isAdvisoriesComplete, isValidatorSet } = useSelector( const { subStepAdvisories, isValidatorSet } = useSelector(
(state: RootState) => state.advisories, (state: RootState) => state.advisories,
) )

View File

@ -1,34 +1,30 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { createSlice, PayloadAction } from '@reduxjs/toolkit'
interface AdvisoriesState { interface AdvisoriesState {
subStepAdvisories: number subStepAdvisories: number
isAdvisoriesComplete: boolean isValidatorSet: boolean
isValidatorSet: boolean
} }
const initialState = { const initialState = {
subStepAdvisories: 0, subStepAdvisories: 0,
isAdvisoriesComplete: false, isAdvisoriesComplete: false,
isValidatorSet: false, isValidatorSet: false,
} }
const AdvisoriesSlice = createSlice({ const AdvisoriesSlice = createSlice({
name: 'execClient', name: 'execClient',
initialState, initialState,
reducers: { reducers: {
setSubStepAdvisories: (state: AdvisoriesState, action: PayloadAction<number>) => { setSubStepAdvisories: (state: AdvisoriesState, action: PayloadAction<number>) => {
state.subStepAdvisories = action.payload state.subStepAdvisories = action.payload
},
setIsValidatorSet: (state: AdvisoriesState, action: PayloadAction<boolean>) => {
state.isValidatorSet = action.payload
},
}, },
setIsAdvisoriesComplete: (state: AdvisoriesState, action: PayloadAction<boolean>) => {
state.isAdvisoriesComplete = action.payload
},
setIsValidatorSet: (state: AdvisoriesState, action: PayloadAction<boolean>) => {
state.isValidatorSet = action.payload
},
},
}) })
export const { setSubStepAdvisories, setIsAdvisoriesComplete, setIsValidatorSet } = export const { setSubStepAdvisories, setIsValidatorSet } =
AdvisoriesSlice.actions AdvisoriesSlice.actions
export default AdvisoriesSlice.reducer export default AdvisoriesSlice.reducer