feat: create new reducers for ports and addresses

This commit is contained in:
RadoslavDimchev 2024-01-05 09:46:42 +02:00
parent a7658bdde4
commit e7ca4b66cb
1 changed files with 14 additions and 11 deletions

View File

@ -20,21 +20,24 @@ const pairDeviceSlice = createSlice({
name: 'pairDevice',
initialState,
reducers: {
setAddress: (
state,
action: PayloadAction<{ nodeAddress: string; beaconAddress: string; vcAddress: string }>,
) => {
state.nodeAddress = action.payload.nodeAddress
state.beaconAddress = action.payload.beaconAddress
state.vcAddress = action.payload.vcAddress
setBeaconPort: (state, action: PayloadAction<string>) => {
state.beaconPort = action.payload
},
setPort: (state, action: PayloadAction<{ beaconPort: string; vcPort: string }>) => {
state.beaconPort = action.payload.beaconPort
state.vcPort = action.payload.vcPort
setVcPort: (state, action: PayloadAction<string>) => {
state.vcPort = action.payload
},
setBeaconAddress: (state, action: PayloadAction<string>) => {
state.beaconAddress = action.payload
},
setVcAddress: (state, action: PayloadAction<string>) => {
state.vcAddress = action.payload
},
setNodeAddress: (state, action: PayloadAction<string>) => {
state.nodeAddress = action.payload
},
},
})
export const { setAddress, setPort } = pairDeviceSlice.actions
export const {} = pairDeviceSlice.actions
export default pairDeviceSlice.reducer