diff --git a/src/redux/PairDevice/slice.ts b/src/redux/PairDevice/slice.ts index fbee2281..fbf8a92a 100644 --- a/src/redux/PairDevice/slice.ts +++ b/src/redux/PairDevice/slice.ts @@ -6,6 +6,12 @@ type PairDeviceStateType = { nodeAddress: string beaconAddress: string vcAddress: string + isNodeSwitchOn: boolean + isBeaconSwitchOn: boolean + isVcSwitchOn: boolean + isNodeChecked: boolean + isBeaconChecked: boolean + isVcChecked: boolean } const initialState: PairDeviceStateType = { @@ -14,6 +20,12 @@ const initialState: PairDeviceStateType = { nodeAddress: 'http://124.0.0.1', beaconAddress: 'http://124.0.0.1', vcAddress: 'http://124.0.0.1', + isNodeSwitchOn: false, + isBeaconSwitchOn: false, + isVcSwitchOn: false, + isNodeChecked: false, + isBeaconChecked: false, + isVcChecked: false, } const pairDeviceSlice = createSlice({ @@ -36,6 +48,24 @@ const pairDeviceSlice = createSlice({ state.nodeAddress = action.payload.value } }, + setIsSwitchOn: (state, action) => { + if (action.payload.switchType === 'Beacon') { + state.isBeaconSwitchOn = action.payload.value + } else if (action.payload.switchType === 'Validator Client') { + state.isVcSwitchOn = action.payload.value + } else { + state.isNodeSwitchOn = action.payload.value + } + }, + setIsChecked: (state, action) => { + if (action.payload.checkType === 'Beacon') { + state.isBeaconChecked = action.payload.value + } else if (action.payload.checkType === 'Validator Client') { + state.isVcChecked = action.payload.value + } else { + state.isNodeChecked = action.payload.value + } + }, }, })