diff --git a/wlm-ui/src/MainPage/Channel/Channel.tsx b/wlm-ui/src/MainPage/Channel/Channel.tsx index 0fc9775..c17cb8d 100644 --- a/wlm-ui/src/MainPage/Channel/Channel.tsx +++ b/wlm-ui/src/MainPage/Channel/Channel.tsx @@ -46,6 +46,16 @@ const Channel = (props: IProps) => { return () => socket.close(); }, [dispatch, props.channel.channel]); + useEffect(() => { + const channel = props.channel.channel; + + const interval = setInterval(() => { + dispatch(channelListActions.removeOldMeasurements({ channel: channel })); + }, 10 * 60 * 1000); + + return () => clearInterval(interval); + }, [dispatch, props.channel.channel]); + useEffect(() => { setIsInUseButtonEnabled(true); }, [props.inUse]); diff --git a/wlm-ui/src/store/slices/channel/channel.ts b/wlm-ui/src/store/slices/channel/channel.ts index 001891b..d9eabc6 100644 --- a/wlm-ui/src/store/slices/channel/channel.ts +++ b/wlm-ui/src/store/slices/channel/channel.ts @@ -102,6 +102,9 @@ export const channelListSlice = createSlice({ const info = getChannelInfoWithException(state, channel); info.measurements.push(measurement); }, + removeOldMeasurements: (state, action: PayloadAction>) => { + + }, }, extraReducers: (builder) => { builder