From 61e33a9f08b6de7cb6c3ea9d4662062568a31338 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Fri, 18 Aug 2023 13:31:19 +0300 Subject: [PATCH] Fix: warning --- src/redux/deviceHealthCheck/slice.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/redux/deviceHealthCheck/slice.tsx b/src/redux/deviceHealthCheck/slice.tsx index 6808ab05..53e60cc0 100644 --- a/src/redux/deviceHealthCheck/slice.tsx +++ b/src/redux/deviceHealthCheck/slice.tsx @@ -24,19 +24,25 @@ const deviceHealthSlice = createSlice({ name: 'deviceHealth', initialState, reducers: { - setStorage: (state, action: PayloadAction<{ storage: number; maxStorage: number }>) => { + setStorage: ( + state: DeviceHealthState, + action: PayloadAction<{ storage: number; maxStorage: number }>, + ) => { state.storage = action.payload.storage state.maxStorage = action.payload.maxStorage }, - setCpuLoad: (state, action: PayloadAction) => { + setCpuLoad: (state: DeviceHealthState, action: PayloadAction) => { state.cpuLoad = action.payload }, - setMemory: (state, action: PayloadAction<{ memory: number[]; maxMemory: number }>) => { + setMemory: ( + state: DeviceHealthState, + action: PayloadAction<{ memory: number[]; maxMemory: number }>, + ) => { state.memory = action.payload.memory state.maxMemory = action.payload.maxMemory }, setNetworkHealth: ( - state, + state: DeviceHealthState, action: PayloadAction<{ uploadRate: number[]; downloadRate: number[] }>, ) => { state.uploadRate = action.payload.uploadRate @@ -45,7 +51,6 @@ const deviceHealthSlice = createSlice({ }, }) -export const { setStorage, setCpuLoad, setMemory, setNetworkHealth} = - deviceHealthSlice.actions +export const { setStorage, setCpuLoad, setMemory, setNetworkHealth } = deviceHealthSlice.actions export default deviceHealthSlice.reducer