refactor: expire msg timer

This commit is contained in:
Tristan Yang
2022-12-28 17:28:11 +08:00
parent def768b4c4
commit 2733600c3b
5 changed files with 37 additions and 18 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ const userMsgSlice = createSlice({
state.ids.push(+id);
}
},
removeUserMsg(state, action) {
removeUserMsg(state, action: PayloadAction<{ id: number, mid: number }>) {
const { id, mid } = action.payload;
if (state.byId[id]) {
const idx = state.byId[id].findIndex((i: number) => i == mid);