refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-28 08:57:42 +08:00
parent 974432a0af
commit e26b6f0fcc
28 changed files with 121 additions and 120 deletions
+2 -2
View File
@@ -87,14 +87,14 @@ const footprintSlice = createSlice({
}
});
},
updateReadUsers(state, action: PayloadAction<{ uid: number; mid: number }[]>) {
updateReadUsers(state, action: PayloadAction<{ uid: number; mid: number }[] | undefined>) {
const reads = action.payload || [];
if (reads.length == 0) return;
reads.forEach(({ uid, mid }) => {
state.readUsers[uid] = mid;
});
},
updateReadChannels(state, action: PayloadAction<{ gid: number; mid: number }[]>) {
updateReadChannels(state, action: PayloadAction<{ gid: number; mid: number }[] | undefined>) {
const reads = action.payload || [];
if (reads.length == 0) return;
reads.forEach(({ gid, mid }) => {