chore: stash feed pagination
This commit is contained in:
@@ -33,6 +33,16 @@ const channelMsgSlice = createSlice({
|
||||
}
|
||||
}
|
||||
},
|
||||
replaceChannelMsg(state, action) {
|
||||
const { id, localMid, serverMid } = action.payload;
|
||||
if (state[id]) {
|
||||
const localIdx = state[id].findIndex((i) => i == localMid);
|
||||
if (localIdx > -1 && serverMid) {
|
||||
// 存在 则再删除
|
||||
state[id].splice(localIdx, 1, serverMid);
|
||||
}
|
||||
}
|
||||
},
|
||||
removeChannelSession(state, action) {
|
||||
const ids = Array.isArray(action.payload)
|
||||
? action.payload
|
||||
@@ -49,5 +59,6 @@ export const {
|
||||
fullfillChannelMsg,
|
||||
addChannelMsg,
|
||||
removeChannelMsg,
|
||||
replaceChannelMsg,
|
||||
} = channelMsgSlice.actions;
|
||||
export default channelMsgSlice.reducer;
|
||||
|
||||
@@ -42,6 +42,16 @@ const userMsgSlice = createSlice({
|
||||
}
|
||||
}
|
||||
},
|
||||
replaceUserMsg(state, action) {
|
||||
const { id, localMid, serverMid } = action.payload;
|
||||
if (state.byId[id]) {
|
||||
const localIdx = state.byId[id].findIndex((i) => i == localMid);
|
||||
if (localIdx > -1 && serverMid) {
|
||||
// 存在 则再删除
|
||||
state.byId[id].splice(localIdx, 1, serverMid);
|
||||
}
|
||||
}
|
||||
},
|
||||
removeUserSession(state, action) {
|
||||
const ids = Array.isArray(action.payload)
|
||||
? action.payload
|
||||
@@ -59,5 +69,6 @@ export const {
|
||||
fullfillUserMsg,
|
||||
addUserMsg,
|
||||
removeUserMsg,
|
||||
replaceUserMsg,
|
||||
} = userMsgSlice.actions;
|
||||
export default userMsgSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user